I recently started using RoR and love it! I’m currently creating some
Remember to alternate frequently between testing and coding, to see
what your new code is doing!
and found this line in the scaffolding for a controller
test: assert assigns(:users)
What does it mean? I know what assert does but couldn’t find any
documentation on the function assigns.
Me neither - I learned it after joining a team already doing Rails
It means a controller said @users = something. You can fetch out any
new controller instance variable with assigns().
I would also use assert_select() or assert_xpath() to parse the
rendered HTML and find evidence the controller’s data appeared there.
Just because a controller assigned something doesn’t mean the user can
http://tinyurl.com/23tlu5 <-- assert_raise_message