paint-brush
Assigns in Ruby on Rails — How you can test instance variables in views and controllersby@ryanwhocodes
9,587 reads
9,587 reads

Assigns in Ruby on Rails — How you can test instance variables in views and controllers

by ryanwhocodes3mJune 13th, 2018
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

Too Long; Didn't Read

<a href="https://rubyonrails.org/">Ruby on Rails</a> has special helper methods that allow you to test instance variables in your app’s <a href="http://guides.rubyonrails.org/action_view_overview.html">views</a> and <a href="http://guides.rubyonrails.org/action_controller_overview.html">controllers</a>. These are assign and assigns, which stores a hash of the instance variables you can access in your <a href="http://rspec.info/">RSpec</a>&nbsp;tests.
featured image - Assigns in Ruby on Rails — How you can test instance variables in views and controllers
ryanwhocodes HackerNoon profile picture
ryanwhocodes

ryanwhocodes

@ryanwhocodes

L O A D I N G
. . . comments & more!

About Author

TOPICS

THIS ARTICLE WAS FEATURED IN...

Permanent on Arweave
Read on Terminal Reader
Read this story in a terminal
 Terminal
Read this story w/o Javascript
Read this story w/o Javascript
 Lite