Skip to content

Commit 946b444

Browse files
committed
Use message spys so that DatabaseCleaner doesn't trigger the expectation
1 parent 2b28816 commit 946b444

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

spec/unit/blacklight/access_controls/search_builder_spec.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,9 @@
2828
let(:ability) { instance_double(Ability, user_groups: [], current_user: user) }
2929

3030
it 'is called with debug' do
31-
expect(Rails.logger).to receive(:debug).with(/^Solr parameters/)
31+
allow(Rails.logger).to receive(:debug)
3232
search_builder.send(:apply_gated_discovery, {})
33+
expect(Rails.logger).to have_received(:debug).with(/^Solr parameters/)
3334
end
3435
end
3536

spec/unit/enforcement_spec.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,9 @@ class MyController
4040
let(:ability) { instance_double(Ability, user_groups: [], current_user: user) }
4141

4242
it 'is called with debug' do
43-
expect(Rails.logger).to receive(:debug).with(/^Solr parameters/)
43+
allow(Rails.logger).to receive(:debug)
4444
controller.send(:apply_gated_discovery, {})
45+
expect(Rails.logger).to have_received(:debug).with(/^Solr parameters/)
4546
end
4647
end
4748

0 commit comments

Comments
 (0)