I'm upgrading my tests to Rspec3 (what a bother), removing all my 'shoulds', but I can't work out how to upgrade 'view.stub' in my view tests.
I am using devise
example:
view.stub(:current_user) { nil }
render
expect(rendered).to .... etc
This gives me a deprecation warning:
Using
stub
from rspec-mocks' old:should
syntax without explicitly enabling the syntax is deprecated. Use the new:expect
syntax or explicitly enable:should
instead. Called from ....
I can't work out how to upgrade to the new 'improved' syntax. Thanks
allow(view).to receive_messages(current_user: nil)
Notable Changes in RSpec 3
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With