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
Adam Flanagan
8,022 PointsTesting Issues
Hi,
I'm near completion(2 min mark) of the video Fixtures in Stage 5 of Build A Simple Ruby On Rails App. However when I run the test it comes back negative with:
4 tests, 0 assertions, 0 failures, 4 errors, 0 skips
The error messages are rather long and all much the same so I will just provide one:
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 ('Jason', 'Seifer', 'jason@teamtreehouse.com', 'jasonseifer', 'password', 'password', '2013-12-31 02:19:39', '2013-12-31 02:19:39', 149087659)
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/sqlite3-1.3.8/lib/sqlite3/database.rb:91:in `initialize'
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/sqlite3-1.3.8/lib/sqlite3/database.rb:91:in `new'
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/sqlite3-1.3.8/lib/sqlite3/database.rb:91:in `prepare'
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/sqlite3-1.3.8/lib/sqlite3/database.rb:134:in `execute'
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/activerecord-3.2.12/lib/active_record/connection_adapters/sqlite_adapter.rb:278:in `block in execute'
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/activerecord-3.2.12/lib/active_record/connection_adapters/abstract_adapter.rb:280:in `block in log'
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/activesupport-3.2.12/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/activerecord-3.2.12/lib/active_record/connection_adapters/abstract_adapter.rb:275:in `log'
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/activerecord-3.2.12/lib/active_record/connection_adapters/sqlite_adapter.rb:278:in `execute'
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/activerecord-3.2.12/lib/active_record/connection_adapters/abstract/database_statements.rb:277:in `insert_fixture'
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/activerecord-3.2.12/lib/active_record/fixtures.rb:502:in `block (5 levels) in create_fixtures'
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/activerecord-3.2.12/lib/active_record/fixtures.rb:501:in `each'
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/activerecord-3.2.12/lib/active_record/fixtures.rb:501:in `block (4 levels) in create_fixtures'
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/activerecord-3.2.12/lib/active_record/fixtures.rb:500:in `each'
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/activerecord-3.2.12/lib/active_record/fixtures.rb:500:in `block (3 levels) in create_fixtures'
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/activerecord-3.2.12/lib/active_record/fixtures.rb:492:in `each'
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/activerecord-3.2.12/lib/active_record/fixtures.rb:492:in `block (2 levels) in create_fixtures'
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/activerecord-3.2.12/lib/active_record/connection_adapters/abstract/database_statements.rb:192:in `transaction'
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/activerecord-3.2.12/lib/active_record/fixtures.rb:491:in `block in create_fixtures'
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/activerecord-3.2.12/lib/active_record/connection_adapters/abstract_adapter.rb:168:in `disable_referential_integrity'
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/activerecord-3.2.12/lib/active_record/fixtures.rb:476:in `create_fixtures'
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/activerecord-3.2.12/lib/active_record/fixtures.rb:895:in `load_fixtures'
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/activerecord-3.2.12/lib/active_record/fixtures.rb:849:in `setup_fixtures'
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/activesupport-3.2.12/lib/active_support/callbacks.rb:407:in `_run__820012871124168835__setup__3576694889808327839__callbacks'
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/activesupport-3.2.12/lib/active_support/callbacks.rb:405:in `__run_callback'
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/activesupport-3.2.12/lib/active_support/callbacks.rb:385:in `_run_setup_callbacks'
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/activesupport-3.2.12/lib/active_support/callbacks.rb:81:in `run_callbacks'
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/activesupport-3.2.12/lib/active_support/testing/setup_and_teardown.rb:35:in `run'
Any ideas??
Help is obviously much appreciated.
Thanks,
Adam
P.S
Also Jim Hoskins, Jason Seifer if you could give any advice I'd be really appreciative???
1 Answer
Jason Seifer
Treehouse Guest TeacherHey Adam Flannery! Try taking out the password and password_confirmation fields in your test/fixtures/users.yml file. We fix this later on.
Naomi Freeman
Treehouse Guest TeacherNaomi Freeman
Treehouse Guest TeacherI'm sure you've noticed there are differences between Treehouse Rails stuff and Rails 4. Maybe the Rails Guides for upgrading docs can help:
http://edgeguides.rubyonrails.org/upgrading_ruby_on_rails.html Just ctrl or cmd + f and look for fixtures.
You might have to change stuff at the top of your code that I can't see here. Let me know if you figure it out :)