Saturday, 14 September 2013

Hartl's RoR Chapter 8.2.5 - UsersController sign_in undefined

Hartl's RoR Chapter 8.2.5 - UsersController sign_in undefined

I'm going through Hartl's RoR Tutorial, Chapter 8.2.5
(http://ruby.railstutorial.org/chapters/sign-in-sign-out#sec-signin_upon_signup)
and I couldn't get the "User Pages signup with valid information should
create a user" test to past, with the following messages:
1) User Pages signup with valid information should create a user
Failure/Error: expect {click_button submit}.to change(User, :count).by(1)
NoMethodError:
undefined method `sign_in' for #<UsersController:0x007fcdb3b066d8>
I was able to solve this by using
include SessionsHelper
in the users_controller.rb. I want to make sure that this was what was
implied, and that I am not doing something wrong as I couldn't find the
instructions for including SessionsHelper in the text.

No comments:

Post a Comment