Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Ruby User Authentication with Rails Adding User Support to Our Application Fixing Our Tests

Create_spec still failing "Email is invalid"

It is complaining about line #4 in the file:

let(:user) { create(:user) }

Can't remember where 'create' came from / was it something we defined in a controller? I think the line is okay, but something is wrong in another file

2 Answers

Hi John,

It might be somewhere but I think let's check your spec_helper.rb under views folder. Make sure you added below:

# put this in line # 21
config.include AuthenticationHelpers::Feature, type: :feature

See example - @2:33

Now check other file again - authenticationhelpers.rb under support from spec folder, see the line # 9 - 16. @3:24

module Feature
 def sign_in(user, options={})
      ... 
     fill_in "Email", with: user.email
     ...
     ...
    end
  end
end

Hope that helps.

Thanks for you help Salman, I already have those 2 things in place, character for character, and I reviewed the videos twice looking for errors ... but still no luck.
I even checked the def create in the User controller

I ended up giving up on that one and just re-downloaded the project files done at that point and now my tests all pass (big surprise)

I don't know if I ever would have figured that one out, and I just want to get through this course and finish it