Hello Jon,
Thank you very much for your answer! In unit testing I also tend to:
- assign the result of the method under test to subject;
- name the subject
Which is exactly what you show in your example. I also do something similar
for request specs:
```
subject(:create_user) { post users_path, params: { user: {name: 'John' } } }
and then
expect { create_user }.to change { User.count }.by(1)
```
--
You received this message because you are subscribed to the Google Groups
"rspec" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/rspec/50ee5c6b-7847-4d72-b570-93664d1037a7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.