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
Shur Jyun Lur
3,411 PointsRuby - Testing The Whole App
Hello, when following along with the very first video of this sequence (Integration Tests), I get the following errors when the video does not have errors:
1) Error:
test_that_/login_route_opens_the_login_pages(CustomRoutesTest):
ActiveRecord::StatementInvalid: SQLite3::SQLException: table users has no column
named password: INSERT INTO "users" ("first_name", "last_name", "email", "profi
le_name", "password", "password_confirmation", "created_at", "updated_at", "id")
VALUES ('Jenny', 'Lur', 'jennylu302@yahoo.com.tw', 'Lur', 'xxxxxxxx', 'xxxxxxxxx', '2013-05-03 02:43:54', '2013-05-03 02:43:54', 162985565)
2) Error:
test_that_/logout_route_opens_the_log_out_pages(CustomRoutesTest):
ActiveRecord::StatementInvalid: SQLite3::SQLException: table users has no column
named password: INSERT INTO "users" ("first_name", "last_name", "email", "profi
le_name", "password", "password_confirmation", "created_at", "updated_at", "id")
VALUES ('Jenny', 'Lur', 'jennylu302@yahoo.com.tw', 'Lur', 'xxxxxxxx', 'xxxxxxxxx', '2013-05-03 02:43:54', '2013-05-03 02:43:54', 162985565)
3) Error:
test_that_/register_route_opens_the_sign_up_pages(CustomRoutesTest):
ActiveRecord::StatementInvalid: SQLite3::SQLException: table users has no column
named password: INSERT INTO "users" ("first_name", "last_name", "email", "profi
le_name", "password", "password_confirmation", "created_at", "updated_at", "id")
VALUES ('Jenny', 'Lur', 'jennylu302@yahoo.com.tw', 'Lur', 'xxxxxx', 'xxxxxxxxxx', '2013-05-03 02:43:54', '2013-05-03 02:43:54', 162985565)
1 Answer
Philipp Antar
7,216 PointsThe errors indicate that the problem has to do with the database. Rails could not find the columns named "password". To update your database, run these commands in the terminal:
rake db:migrate
followed by
rake db:test:prepare
This will check that your database is up to date and run the migrations if necessary, it will also rebuild the test database which is seperate from the development and production database.