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
Krishna Ramachandran
Courses Plus Student 5,559 PointsError when testing RoR Application "Could not find table 'statuses'"
I am in Building a Simple RoR application and trying to test the app.
I keep getting the following error anytime I try to run a test:
1) Error:test_that_/login_route_opens_the_login_page(CustomRoutesTest):
ActiveRecord::StatementInvalid: Could not find table 'statuses'
Anyone know what I can do to get tests working?
1 Answer
Brandon Barrette
20,485 PointsYour test database is not there. Run:
rake db:test prepare
Krishna Ramachandran
Courses Plus Student 5,559 PointsKrishna Ramachandran
Courses Plus Student 5,559 PointsThanks Brandon for your response: I ran the code you said to and ran the test. I got the following error <class:TestCast>':uninitialized constant Devise::TestHeplers (NameError)
From doing some more digging it seemed I need to add the following to my Gem file which I did but it still didn't work: require 'Devise'
still getting <class:TestCase>': uninitialized constant Devise::TestHeplers (NameError)
Any ideas?
Sandra Weber
1,531 PointsSandra Weber
1,531 PointsIn your Gemfile, try addding
gem 'devise'instead. "require 'Devise" isn't the correct syntax for a Gemfile. After you've done that, in your console run
bundle installThis will install all of the gems that are listed in your Gemfile, which will now include the Devise gem. :)