We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Currently one can use a shorthand version of double which is very useful, as in:
user = double(:user, id: 1, username: 'admin')
It would be useful to extend this feature when stubbing existing objects as in:
allow(controller).to receive(:authenticate_user!, current_user: user, ...)
The idea is to extract latest argument if it is a hash. In that case, the values will be the return value for the methods as the key names.
For the other arguments, just stubs them as in:
allow(controller).to receive :authenticate_user!
I'd much prefer this style for lots of my stubbings...
The text was updated successfully, but these errors were encountered:
This is a duplicate of #368. Closing so we can keep the discussion there, in one place.
Sorry, something went wrong.
No branches or pull requests
Currently one can use a shorthand version of double which is very useful, as in:
It would be useful to extend this feature when stubbing existing objects as in:
The idea is to extract latest argument if it is a hash. In that case, the values will be the return value for the methods as the key names.
For the other arguments, just stubs them as in:
I'd much prefer this style for lots of my stubbings...
The text was updated successfully, but these errors were encountered: