I need to test that a piece of code executes two sql statements, which I'm doing by saying
ActiveRecord::Base.connection.should_receive(:execute).with("s1")
ActiveRecord::Base.connection.should_receive(:execute).with("s2")
However, the code also executes a lot of other statements that I don't care about, which trips up the test. How do I tell Rspec to make sure that s1
and s2
are in the list of executed statements?