From a72a3f6d9c479472aa319bc3ee0d423b8ad4963b Mon Sep 17 00:00:00 2001 From: pjurewicz Date: Thu, 7 Dec 2023 11:58:52 +0100 Subject: [PATCH] document monotonic_id_batch_reader better WHERE clause is present in the 2nd query the first query do not need any condition --- .../spec/event_repository_spec.rb | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/ruby_event_store-active_record/spec/event_repository_spec.rb b/ruby_event_store-active_record/spec/event_repository_spec.rb index f4cb0f5427..b0c032df5e 100644 --- a/ruby_event_store-active_record/spec/event_repository_spec.rb +++ b/ruby_event_store-active_record/spec/event_repository_spec.rb @@ -10,7 +10,6 @@ module ActiveRecord it_behaves_like :event_repository, mk_repository, helper - let(:repository) { mk_repository.call } let(:specification) do Specification.new( @@ -236,9 +235,12 @@ module ActiveRecord ExpectedVersion.any ) - expect { - repository.read(specification.in_batches(3).result).to_a - }.to match_query /SELECT.*FROM.*event_store_events.*WHERE.*event_store_events.id >*.*ORDER BY .*event_store_events.*id.* ASC LIMIT.*/ + ::ActiveRecord::Base.logger = Logger.new(STDOUT) + expect do + expect do + repository.read(specification.in_batches(3).result).to_a + end.to match_query /SELECT.*FROM .event_store_events. ORDER BY .event_store_events.\..id. ASC LIMIT/ + end.to match_query /SELECT.*FROM .event_store_events. WHERE .event_store_events\.id >.* ORDER BY .event_store_events.\..id. ASC LIMIT/ end specify "produces expected query for position in stream call" do