mirror of
https://github.com/basecamp/once-campfire.git
synced 2026-10-09 00:00:12 +09:00
ad541b1c6a
Keep the test of what page_updated_since returns, which covers the rewritten scope; pinning SQLite's plan locks in more than the change needs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0142qgjggdJ2KDdGk7RF9Xm9
17 lines
505 B
Ruby
17 lines
505 B
Ruby
require "test_helper"
|
|
|
|
class Message::PaginationTest < ActiveSupport::TestCase
|
|
test "messages updated since a time are the newest page of them, in creation order" do
|
|
room = rooms(:watercooler)
|
|
first, second, third = room.messages.ordered.first(3)
|
|
|
|
travel 1.minute do
|
|
[ third, first, second ].each(&:touch)
|
|
|
|
stub_const(Message::Pagination, :PAGE_SIZE, 2) do
|
|
assert_equal [ second, third ], room.messages.page_updated_since(30.seconds.ago).to_a
|
|
end
|
|
end
|
|
end
|
|
end
|