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 trialTerence Mylonas
985 PointsRuby on Rails Fixtures - Getting Error When Running Test
Hi folks, Can't seem to get the fixtures test to execute properly. I'm getting the following errors when I run "ruby -Itest test/unit/user_test.rb" in terminal. The results are supposed to show 4 tests, 8 assertions, but mine's showing 4 tests, 0 assertions and 4 errors. Not sure what I've done wrong here.
Thanks for the feedback.
1) Error:
test_a_user_should_enter_a_first_name(UserTest):
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 ('Terence', 'Something', 'something@gmail.com', 'terence', 'password', 'password', '2013-03-05 18:25:18', '2013-03-05 18:25:18', 601442985)
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/sqlite3-1.3.7/lib/sqlite3/database.rb:91:in initialize'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/sqlite3-1.3.7/lib/sqlite3/database.rb:91:in
new'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/sqlite3-1.3.7/lib/sqlite3/database.rb:91:in prepare'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/sqlite3-1.3.7/lib/sqlite3/database.rb:134:in
execute'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.8/lib/active_record/connection_adapters/sqlite_adapter.rb:278:in block in execute'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.8/lib/active_record/connection_adapters/abstract_adapter.rb:280:in
block in log'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.8/lib/active_support/notifications/instrumenter.rb:20:in instrument'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.8/lib/active_record/connection_adapters/abstract_adapter.rb:275:in
log'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.8/lib/active_record/connection_adapters/sqlite_adapter.rb:278:in execute'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.8/lib/active_record/connection_adapters/abstract/database_statements.rb:277:in
insert_fixture'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.8/lib/active_record/fixtures.rb:502:in block (5 levels) in create_fixtures'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.8/lib/active_record/fixtures.rb:501:in
each'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.8/lib/active_record/fixtures.rb:501:in block (4 levels) in create_fixtures'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.8/lib/active_record/fixtures.rb:500:in
each'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.8/lib/active_record/fixtures.rb:500:in block (3 levels) in create_fixtures'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.8/lib/active_record/fixtures.rb:492:in
each'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.8/lib/active_record/fixtures.rb:492:in block (2 levels) in create_fixtures'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.8/lib/active_record/connection_adapters/abstract/database_statements.rb:192:in
transaction'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.8/lib/active_record/fixtures.rb:491:in block in create_fixtures'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.8/lib/active_record/connection_adapters/abstract_adapter.rb:168:in
disable_referential_integrity'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.8/lib/active_record/fixtures.rb:476:in create_fixtures'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.8/lib/active_record/fixtures.rb:895:in
load_fixtures'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.8/lib/active_record/fixtures.rb:849:in setup_fixtures'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:407:in
run2803858945567782319setup3651528410001218198callbacks'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:405:in `_run_callback'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:385:in _run_setup_callbacks'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:81:in
run_callbacks'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.8/lib/active_support/testing/setup_and_teardown.rb:35:in `run'
2) Error:
test_a_user_should_enter_a_last_name(UserTest):
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 ('Terence', 'Something', 'something@gmail.com', 'terence', 'password', 'password', '2013-03-05 18:25:18', '2013-03-05 18:25:18', 601442985)
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/sqlite3-1.3.7/lib/sqlite3/database.rb:91:in initialize'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/sqlite3-1.3.7/lib/sqlite3/database.rb:91:in
new'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/sqlite3-1.3.7/lib/sqlite3/database.rb:91:in prepare'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/sqlite3-1.3.7/lib/sqlite3/database.rb:134:in
execute'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.8/lib/active_record/connection_adapters/sqlite_adapter.rb:278:in block in execute'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.8/lib/active_record/connection_adapters/abstract_adapter.rb:280:in
block in log'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.8/lib/active_support/notifications/instrumenter.rb:20:in instrument'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.8/lib/active_record/connection_adapters/abstract_adapter.rb:275:in
log'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.8/lib/active_record/connection_adapters/sqlite_adapter.rb:278:in execute'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.8/lib/active_record/connection_adapters/abstract/database_statements.rb:277:in
insert_fixture'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.8/lib/active_record/fixtures.rb:502:in block (5 levels) in create_fixtures'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.8/lib/active_record/fixtures.rb:501:in
each'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.8/lib/active_record/fixtures.rb:501:in block (4 levels) in create_fixtures'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.8/lib/active_record/fixtures.rb:500:in
each'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.8/lib/active_record/fixtures.rb:500:in block (3 levels) in create_fixtures'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.8/lib/active_record/fixtures.rb:492:in
each'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.8/lib/active_record/fixtures.rb:492:in block (2 levels) in create_fixtures'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.8/lib/active_record/connection_adapters/abstract/database_statements.rb:192:in
transaction'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.8/lib/active_record/fixtures.rb:491:in block in create_fixtures'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.8/lib/active_record/connection_adapters/abstract_adapter.rb:168:in
disable_referential_integrity'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.8/lib/active_record/fixtures.rb:476:in create_fixtures'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.8/lib/active_record/fixtures.rb:895:in
load_fixtures'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.8/lib/active_record/fixtures.rb:849:in setup_fixtures'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:407:in
run2803858945567782319setup3651528410001218198callbacks'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:405:in `_run_callback'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:385:in _run_setup_callbacks'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:81:in
run_callbacks'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.8/lib/active_support/testing/setup_and_teardown.rb:35:in `run'
3) Error:
test_a_user_should_enter_a_profile_name(UserTest):
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 ('Terence', 'Something', 'something@gmail.com', 'terence', 'password', 'password', '2013-03-05 18:25:18', '2013-03-05 18:25:18', 601442985)
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/sqlite3-1.3.7/lib/sqlite3/database.rb:91:in initialize'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/sqlite3-1.3.7/lib/sqlite3/database.rb:91:in
new'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/sqlite3-1.3.7/lib/sqlite3/database.rb:91:in prepare'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/sqlite3-1.3.7/lib/sqlite3/database.rb:134:in
execute'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.8/lib/active_record/connection_adapters/sqlite_adapter.rb:278:in block in execute'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.8/lib/active_record/connection_adapters/abstract_adapter.rb:280:in
block in log'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.8/lib/active_support/notifications/instrumenter.rb:20:in instrument'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.8/lib/active_record/connection_adapters/abstract_adapter.rb:275:in
log'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.8/lib/active_record/connection_adapters/sqlite_adapter.rb:278:in execute'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.8/lib/active_record/connection_adapters/abstract/database_statements.rb:277:in
insert_fixture'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.8/lib/active_record/fixtures.rb:502:in block (5 levels) in create_fixtures'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.8/lib/active_record/fixtures.rb:501:in
each'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.8/lib/active_record/fixtures.rb:501:in block (4 levels) in create_fixtures'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.8/lib/active_record/fixtures.rb:500:in
each'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.8/lib/active_record/fixtures.rb:500:in block (3 levels) in create_fixtures'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.8/lib/active_record/fixtures.rb:492:in
each'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.8/lib/active_record/fixtures.rb:492:in block (2 levels) in create_fixtures'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.8/lib/active_record/connection_adapters/abstract/database_statements.rb:192:in
transaction'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.8/lib/active_record/fixtures.rb:491:in block in create_fixtures'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.8/lib/active_record/connection_adapters/abstract_adapter.rb:168:in
disable_referential_integrity'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.8/lib/active_record/fixtures.rb:476:in create_fixtures'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.8/lib/active_record/fixtures.rb:895:in
load_fixtures'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.8/lib/active_record/fixtures.rb:849:in setup_fixtures'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:407:in
run2803858945567782319setup3651528410001218198callbacks'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:405:in `_run_callback'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:385:in _run_setup_callbacks'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:81:in
run_callbacks'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.8/lib/active_support/testing/setup_and_teardown.rb:35:in `run'
4) Error:
test_a_user_should_have_a_unique_profile_name(UserTest):
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 ('Terence', 'Something', 'something@gmail.com', 'terence', 'password', 'password', '2013-03-05 18:25:18', '2013-03-05 18:25:18', 601442985)
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/sqlite3-1.3.7/lib/sqlite3/database.rb:91:in initialize'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/sqlite3-1.3.7/lib/sqlite3/database.rb:91:in
new'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/sqlite3-1.3.7/lib/sqlite3/database.rb:91:in prepare'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/sqlite3-1.3.7/lib/sqlite3/database.rb:134:in
execute'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.8/lib/active_record/connection_adapters/sqlite_adapter.rb:278:in block in execute'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.8/lib/active_record/connection_adapters/abstract_adapter.rb:280:in
block in log'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.8/lib/active_support/notifications/instrumenter.rb:20:in instrument'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.8/lib/active_record/connection_adapters/abstract_adapter.rb:275:in
log'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.8/lib/active_record/connection_adapters/sqlite_adapter.rb:278:in execute'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.8/lib/active_record/connection_adapters/abstract/database_statements.rb:277:in
insert_fixture'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.8/lib/active_record/fixtures.rb:502:in block (5 levels) in create_fixtures'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.8/lib/active_record/fixtures.rb:501:in
each'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.8/lib/active_record/fixtures.rb:501:in block (4 levels) in create_fixtures'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.8/lib/active_record/fixtures.rb:500:in
each'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.8/lib/active_record/fixtures.rb:500:in block (3 levels) in create_fixtures'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.8/lib/active_record/fixtures.rb:492:in
each'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.8/lib/active_record/fixtures.rb:492:in block (2 levels) in create_fixtures'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.8/lib/active_record/connection_adapters/abstract/database_statements.rb:192:in
transaction'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.8/lib/active_record/fixtures.rb:491:in block in create_fixtures'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.8/lib/active_record/connection_adapters/abstract_adapter.rb:168:in
disable_referential_integrity'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.8/lib/active_record/fixtures.rb:476:in create_fixtures'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.8/lib/active_record/fixtures.rb:895:in
load_fixtures'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.8/lib/active_record/fixtures.rb:849:in setup_fixtures'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:407:in
run2803858945567782319setup3651528410001218198callbacks'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:405:in `_run_callback'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:385:in _run_setup_callbacks'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:81:in
run_callbacks'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.8/lib/active_support/testing/setup_and_teardown.rb:35:in `run'
7 Answers
Jason Seifer
Treehouse Guest TeacherHey Terence, try removing the "password" and "password_confirmation" fields from your users.yml fixture and run the tests again.
Terence Mylonas
985 PointsAnd that worked perfectly too. Thanks again, Jason!
dmzstudio45
43,976 PointsEvery time I run any test in "Creating Friendships" tutorial, I get errors on all tests.
1) Error:
test_should_be_logged_in_to_post_a_status(StatusesControllerTest):
NoMethodError: undefined method load_session' for nil:NilClass
/Users/DMZStudio/.rvm/gems/ruby-1.9.3-p194@global/gems/rack-1.5.2/lib/rack/session/abstract/id.rb:151:in
load!'
/Users/DMZStudio/.rvm/gems/ruby-1.9.3-p194@global/gems/rack-1.5.2/lib/rack/session/abstract/id.rb:147:in load_for_write!'
/Users/DMZStudio/.rvm/gems/ruby-1.9.3-p194@global/gems/rack-1.5.2/lib/rack/session/abstract/id.rb:100:in
replace'
/Users/DMZStudio/.rvm/gems/ruby-1.9.3-p194@global/gems/actionpack-3.2.12/lib/action_controller/test_case.rb:226:in initialize'
/Users/DMZStudio/.rvm/gems/ruby-1.9.3-p194@global/gems/actionpack-3.2.12/lib/action_controller/test_case.rb:138:in
new'
/Users/DMZStudio/.rvm/gems/ruby-1.9.3-p194@global/gems/actionpack-3.2.12/lib/action_controller/test_case.rb:138:in initialize'
/Users/DMZStudio/.rvm/gems/ruby-1.9.3-p194@global/gems/actionpack-3.2.12/lib/action_dispatch/testing/test_request.rb:11:in
new'
/Users/DMZStudio/.rvm/gems/ruby-1.9.3-p194@global/gems/actionpack-3.2.12/lib/action_dispatch/testing/test_request.rb:11:in new'
/Users/DMZStudio/.rvm/gems/ruby-1.9.3-p194@global/gems/actionpack-3.2.12/lib/action_controller/test_case.rb:480:in
setup_controller_request_and_response'
/Users/DMZStudio/.rvm/gems/ruby-1.9.3-p194@global/gems/activesupport-3.2.12/lib/active_support/callbacks.rb:418:in _run__238999531152436347__setup__148079855204179567__callbacks'
/Users/DMZStudio/.rvm/gems/ruby-1.9.3-p194@global/gems/activesupport-3.2.12/lib/active_support/callbacks.rb:405:in
__run_callback'
/Users/DMZStudio/.rvm/gems/ruby-1.9.3-p194@global/gems/activesupport-3.2.12/lib/active_support/callbacks.rb:385:in _run_setup_callbacks'
/Users/DMZStudio/.rvm/gems/ruby-1.9.3-p194@global/gems/activesupport-3.2.12/lib/active_support/callbacks.rb:81:in
run_callbacks'
/Users/DMZStudio/.rvm/gems/ruby-1.9.3-p194@global/gems/activesupport-3.2.12/lib/active_support/testing/setup_and_teardown.rb:35:in `run'
Can't figure out how to fix this issue.
Jason Seifer
Treehouse Guest TeacherCan you paste your test file in an email to help@teamtreehouse.com? Thanks!
Genghua Li
2,072 PointsI had a similar problem with Terence. But I don't understand how he fixed using your suggestion, Jason.
Before deleting everything, I do not see password, and password confirmation fields in users.yml. Even I deleted everything in users.yml there are still errors. Could help me figure out where the problem is?
Here is the error message from the prompt:
test_a_user_should_enter_a_first_name(UserTest):
ActiveRecord::RecordNotUnique: SQLite3::ConstraintException: column email is not
unique: INSERT INTO "views" ("created_at", "updated_at", "id") VALUES ('2013-04
-17 19:02:52', '2013-04-17 19:02:52', 298486374)
D:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/sqlite3-1.3.7-x86-mingw
32/lib/sqlite3/statement.rb:108:in step'
D:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/sqlite3-1.3.7-x86-mingw
32/lib/sqlite3/statement.rb:108:in
block in each'
D:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/sqlite3-1.3.7-x86-mingw
32/lib/sqlite3/statement.rb:107:in loop'
D:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/sqlite3-1.3.7-x86-mingw
32/lib/sqlite3/statement.rb:107:in
each'
D:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/sqlite3-1.3.7-x86-mingw
32/lib/sqlite3/database.rb:149:in map'
D:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/sqlite3-1.3.7-x86-mingw
32/lib/sqlite3/database.rb:149:in
block in execute'
D:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/sqlite3-1.3.7-x86-mingw
32/lib/sqlite3/database.rb:95:in prepare'
D:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/sqlite3-1.3.7-x86-mingw
32/lib/sqlite3/database.rb:134:in
execute'
D:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activerecord-3.2.13/lib
/active_record/connection_adapters/sqlite_adapter.rb:278:in block in execute'
D:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activerecord-3.2.13/lib
/active_record/connection_adapters/abstract_adapter.rb:280:in
block in log'
D:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.2.13/li
b/active_support/notifications/instrumenter.rb:20:in instrument'
D:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activerecord-3.2.13/lib
/active_record/connection_adapters/abstract_adapter.rb:275:in
log'
D:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activerecord-3.2.13/lib
/active_record/connection_adapters/sqlite_adapter.rb:278:in execute'
D:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activerecord-3.2.13/lib
/active_record/connection_adapters/abstract/database_statements.rb:277:in
inser
t_fixture'
D:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activerecord-3.2.13/lib
/active_record/fixtures.rb:502:in block (5 levels) in create_fixtures'
D:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activerecord-3.2.13/lib
/active_record/fixtures.rb:501:in
each'
D:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activerecord-3.2.13/lib
/active_record/fixtures.rb:501:in block (4 levels) in create_fixtures'
D:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activerecord-3.2.13/lib
/active_record/fixtures.rb:500:in
each'
D:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activerecord-3.2.13/lib
/active_record/fixtures.rb:500:in block (3 levels) in create_fixtures'
D:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activerecord-3.2.13/lib
/active_record/fixtures.rb:492:in
each'
D:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activerecord-3.2.13/lib
/active_record/fixtures.rb:492:in block (2 levels) in create_fixtures'
D:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activerecord-3.2.13/lib
/active_record/connection_adapters/abstract/database_statements.rb:192:in
trans
action'
D:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activerecord-3.2.13/lib
/active_record/fixtures.rb:491:in block in create_fixtures'
D:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activerecord-3.2.13/lib
/active_record/connection_adapters/abstract_adapter.rb:168:in
disable_referenti
al_integrity'
D:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activerecord-3.2.13/lib
/active_record/fixtures.rb:476:in create_fixtures'
D:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activerecord-3.2.13/lib
/active_record/fixtures.rb:895:in
load_fixtures'
D:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activerecord-3.2.13/lib
/active_record/fixtures.rb:849:in setup_fixtures'
D:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.2.13/li
b/active_support/callbacks.rb:407:in
run530570934setup892424154callbac
ks'
D:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.2.13/li
b/active_support/callbacks.rb:405:in `_run_callback'
D:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.2.13/li
b/active_support/callbacks.rb:385:in _run_setup_callbacks'
D:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.2.13/li
b/active_support/callbacks.rb:81:in
run_callbacks'
D:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.2.13/li
b/active_support/testing/setup_and_teardown.rb:35:in `run'
Jason Seifer
Treehouse Guest TeacherDo any of the users in the users.yml file have the same email address?
Genghua Li
2,072 PointsMy users.yml file is empty as you demonstrated in your video