Rails assigns helper
Very hard to find documentation on this. RoR E-Commerce pg 51 says:
Assigns is a test helper method that can be used to access all the instance variables set in the last requested action. Makes a lot more sense if I think of it as assigns being the multiple of assign rather than the verb :-)
[ruby]
assert_template ‘admin/author/show’
assert_equal ‘Iain’, assigns(:author).first_name
[/ruby]
Second line means “Is the author assign’s first_name field equal to Iain?”
You must be logged in to post a comment.