|More from: | HackerNoon |||
Ruby on Rails has special helper methods that allow you to test instance variables in your app’s views and controllers. These are assign and assigns, which stores a hash of the instance variables you can access in your RSpec tests.
This tutorial will guide you through how to write a simple controller and view with corresponding tests. These will cover assigning instance variables depending on whether certain conditions are met.
How assign and assigns works
If you want to set a
About | HackerNoon |
...how hackers start their afternoons....