[Rails] undefined method `authenticate' for nil:NilClass

2014-07-21 Thread Roelof Wobben
Hello, I do still follow the Hartl tutorial. Am at chapter 6 and according to the manual the test schould be successfull but I see these error messages: Failures:

Re: [Rails] undefined method `authenticate' for nil:NilClass

2014-07-21 Thread Scott Ribe
On Jul 21, 2014, at 10:19 AM, Roelof Wobben rwob...@hotmail.com wrote: undefined method `authenticate' for nil:NilClass You're calling method authenticate nil. You need to look at your call to authenticate, and figure out why the object is nil. (This could easily be caused by a simple typo.

Re: [Rails] undefined method `authenticate' for nil:NilClass

2014-07-21 Thread Benjamin Iandavid Rodriguez
It seems that you need to create the Devise mapping(If you're using devise), to fix this you can: - Set the devise mapping inside a before block - Include Devise test helpers Here's a link to the Devise Wiki https://github.com/plataformatec/devise#test-helpers Cheers, Ian 2014-07-21 9:26

Re: [Rails] undefined method `authenticate' for nil:NilClass

2014-07-21 Thread Eric Saupe
@Ian, He is not using Devise if he is going through the Hartl tutorial. Scott's suggestion is the one that should be followed. On Monday, July 21, 2014 10:36:01 AM UTC-6, Ian_Rgz wrote: It seems that you need to create the Devise mapping(If you're using devise), to fix this you can: - Set

Re: [Rails] undefined method `authenticate' for nil:NilClass

2014-07-21 Thread Roelof Wobben
Hello, I checked and double checked it but it looks allright to me. I even copy/paste it to my files but still no luck. The problem must be somewhere here: describe with a password that's too short do before { @user.password = @user.password_confirmation = a * 5 } it { should

Re: [Rails] undefined method `authenticate' for nil:NilClass

2014-07-21 Thread Scott Ribe
On Jul 21, 2014, at 10:53 AM, Roelof Wobben rwob...@hotmail.com wrote: Hello, I checked and double checked it but it looks allright to me. I even copy/paste it to my files but still no luck. The problem must be somewhere here: describe with a password that's too short do before

Re: [Rails] undefined method `authenticate' for nil:NilClass

2014-07-21 Thread Roelof Wobben
Nope, Otherwise I would not ask here. user is filled because of this : before do @user = User.new(name: Example User, email: u...@example.com, password: foobar, password_confirmation: foobar) end Op maandag 21 juli 2014 19:09:47 UTC+2 schreef Scott Ribe: On Jul

Re: [Rails] undefined method `authenticate' for nil:NilClass

2014-07-21 Thread Roelof Wobben
I wonder if all the end are right here : https://github.com/roelof1967/sample_app_nutrious/blob/chapter_six/spec/models/user_spec.rb Roelof Op maandag 21 juli 2014 19:23:09 UTC+2 schreef Roelof Wobben: Nope, Otherwise I would not ask here. user is filled because of this : before do