Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
a-lavis committed Jan 9, 2024
1 parent 4945e39 commit 9a9e331
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions spec/query_cache_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -116,4 +116,16 @@ def executor
expect(TestModel.pluck(:id).count).to eql TestModel.all.count
end
end

describe '.ids regression test' do
it 'should work with query caching' do
TestModel.connection.enable_query_cache!
expect(TestModel.ids.count).to eql TestModel.all.count
end

it 'should work if query cache is not enabled' do
TestModel.connection.disable_query_cache!
expect(TestModel.ids.count).to eql TestModel.all.count
end
end
end

0 comments on commit 9a9e331

Please sign in to comment.