Files
once-campfire/test/models/message/pagination_test.rb
T
Marcello Costagliola ad541b1c6a Drop the query plan test
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
2026-10-05 13:59:49 +02:00

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