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
Jordan Hosmer
3,112 PointsRoR Treehouse App - Writing Tests and receiving Errors
Hi, I'm working on the Writing Tests badge for the Ruby on Rails project and am having trouble with a test error.
In the command prompt i'm running the test, and the error shows: ActiveRecord::StatementInvalid: SQLite3::SQLException: table users has no column named password: INSERT INTO "users"
My code looks the same as the example (I've gone back numerous times and verified), from some research, I believe that an update to Devise is asking for a change to the migrate/devise_create_users.rb file. Like possibly adding column for password.... any help?
Thanks!
3 Answers
Jason Seifer
Treehouse Guest TeacherHey Jordan Hosmer, try opening up test/fixtures/users.yml and remove any lines that say password or password_confirmation and that should fix it. Sorry for the trouble!
Jordan Hosmer
3,112 PointsAwesome! Thanks, that worked.
Just to understand that error better... why does it say that there is no column for password, when in fact there is a column for password and password_confirmation? Does it have to do with them being encrypted?
Jason Seifer
Treehouse Guest TeacherIt's because those are virtual attributes that don't exist in the database. Inside the database, the information is stored in a column called "encrypted_password" and calculated in memory based on those two attributes.