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
Maxine Beech
992 PointsValidating Uniqueness
Stage 4 of ROR and failing tests again
test_a_user_should_enter_a_first_name(UserTest): ActiveRecord::StatementInvalid: SQLite3::SQLException: table users has no column named password
Validations for first_name, last_name, profile_name presence are there and uniqueness for profile_name as well
I have a fixture file like this:
maxine: profile_name: "MaxineBeech" first_name: "Maxine" last_name: "Beech" email: "m1@m1.com" password: "password" password_confirmation: "password"
I've looked in the db files and can't find a password field in the devise migrate file
thanks!
1 Answer
Drake Ramming
5,373 PointsRemove the "password" and "password_confirmation" fields from your users.yml fixture.
The Devise migrate file does not have a "password" field, though it does have an "encrypted_password" field. This is because Devise uses a hash algorithm named MD5 to encrypt the password before storing.
A password stored in Devise(post-encryption) would look like this:
encrypted_password: "$2a$10$Fh/Hm8RxDsuPTeBUr6864.GARlcmt7zF2WspaXGr3BIv2C27N.osq"