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

fixture tests password failure

My problem is in writing tests > Fixtures

It somehow fails entering password data in test database. Followed the devise installing to the letter.

ActiveRecord::StatementInvalid: SQLite3::SQLException: table users has no column named password: INSERT INTO "users" ("first_name", "last_name", "email", "profile_name", "password", "password_confirmation", "created_at", "updated_at", "id") VALUES ('Jarjar', 'Binks', 'jarjar@binks.com', 'jarjarbinks', 'password', 'password', '2013-02-07 12:47:28', '2013-02-07 12:47:28', 979681144)

This is after entering data in users.yml

jarjar:
  first_name: "Jarjar"
  last_name: "Binks"
  email: "jarjar@binks.com"
  profile_name: "jarjarbinks"
  password: "password"
  password_confirmation: "password"

7 Answers

Dallas Koncir
Dallas Koncir
813 Points

I am having the same problem. Any solutions out there?

I got past it by leaving them out of the data in the fixture, but it could it be a recent change in devise?

Jason Seifer
STAFF
Jason Seifer
Treehouse Guest Teacher

Try taking out the password and password_confirmation columns from the users fixture and let us know if that helps!

Yup that was how I got through :) thanks

Dallas Koncir
Dallas Koncir
813 Points

Worked for me too, thanks!

In the video: http://teamtreehouse.com/library/programming-2/build-a-simple-version-of-facebook/writing-tests/fixtures <br> Password and password_confirmation are entered into users.yml at 1:08, and the same error messages show up briefly in the video ("table users has no column named password"). Then at 2:14 it shows the users.yml file without the password and confirmation. I think it was an editing error.

Jason Seifer
STAFF
Jason Seifer
Treehouse Guest Teacher

Hey @Devon that's correct. We have it on the roadmap for things to fix and I've added notes to the video to follow along with. Thanks!