Skip to content

Commit c9eed48

Browse files
committed
Fix RSpec/Yield cop violations
1 parent d5d766e commit c9eed48

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

spec/controllers/controller_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@
9090
describe '#login!' do
9191
context 'when succeeds' do
9292
before do
93-
expect(User).to receive(:authenticate).with('[email protected]', 'secret') { |&block| block.call(user, nil) }
93+
expect(User).to receive(:authenticate).with('[email protected]', 'secret').and_yield(user, nil)
9494
get :test_login_bang, params: { email: '[email protected]', password: 'secret' }
9595
end
9696

@@ -119,7 +119,7 @@
119119
describe '#login! with block' do
120120
context 'when succeeds' do
121121
before do
122-
expect(User).to receive(:authenticate).with('[email protected]', 'secret') { |&block| block.call(user, nil) }
122+
expect(User).to receive(:authenticate).with('[email protected]', 'secret').and_yield(user, nil)
123123
get :test_login_bang_with_block, params: { email: '[email protected]', password: 'secret' }
124124
end
125125

0 commit comments

Comments
 (0)