This repository has been archived by the owner on Aug 3, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 229
Instance variable in PATCH controller specs #53
Comments
I see this question a lot ... I'm going to write a blog post to provide some illustrated details. |
Thank you for the response, looking forward for that blog post. |
I haven't forgotten this ... I haven't been feeling well and have been sleeping when I usually write. |
No biggies, thank you really for replying and for putting the work and effort to share your knowledge. Hope you'll get well soon. |
Here you go, hope it helps! http://everydayrails.com/2015/04/05/rspec-assigns-rails-testing.html |
Thank you so much! Great article! |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I need to ask you one quick question and you may find it pretty simple but I just couldn't find the answer for it anywhere.
When I test the controller 'patch' method I run into something that was really intriguing for me.
I understand why we should reload, because of persistance, and that @contact needs to be the same as assigns(:contact), but what I don't understand is why if I print the @contact it shows his old values. Plus if I write an example like this "expect(@contact.name).to eq ' Larry Smith' " it fails.
The text was updated successfully, but these errors were encountered: