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

Ruby on Rails: Validating tests

Hello,

I've been following along step by step in the 'Validating' Presence video, and I'm getting an error when I try to run my test....

ActiveRecord::StatementInvalid: Could not find table 'statuses'

Did I forget to name a table somewhere earlier in the series? :/

15 Answers

Jason Seifer
STAFF
Jason Seifer
Treehouse Guest Teacher

Try running "rake db:migrate" and "rake db:test:prepare" and see if that fixes it.

Thank you, solved my problem, got to run prepare then migrate, for my case.

Hi Jason,

After I run rake db:test:prepare, I'm told to run rake db:migrate again. I'm stuck in a loop lol. I noticed 'AddDeviseToUsers', does my problem have something to do with devise?

www:treebook trevorwilliams$ rake db:test:prepare You have 1 pending migrations: 20130216215424 AddDeviseToUsers Run rake db:migrate to update your database then try again.

Hi I have the same problem with the Statuses table missing error, but nothing seems to fix it? Any ideas why, i am pretty new to this

Thanks Jason that worked for me!

I've been stuck on this for almost 2 weeks... lmao

same here!

try dropping your db, then bundle install, rake db:migrate..I had to reinstall rvm also

Fixed it, but i get these errors now.

1) Error: test_a_user_should_enter_a_first_name(UserTest): NoMethodError: undefined method save' for "User":String test/unit/user_test.rb:6:inblock in <class:UserTest>'

2) Error: test_a_user_should_enter_a_last_name(UserTest): NoMethodError: undefined method save' for "User":String test/unit/user_test.rb:13:inblock in <class:UserTest>'

3) Error: test_a_user_should_enter_a_profile_name(UserTest): NoMethodError: undefined method save' for "User":String test/unit/user_test.rb:20:inblock in <class:UserTest>'

4) Error: test_a_user_should_have_a_unique_profile_name(UserTest): NoMethodError: undefined method profile_name=' for "User":String test/unit/user_test.rb:27:inblock in <class:UserTest>'

then i tried to "rake db:reset" again and now the test doesnt run and i get

test/unit/user_test.rb:43: syntax error, unexpected keyword_end, expecting $end

baffled! lol

I would check your user test code against the tut vid...other than that I couldnt say

oops rookie error, i had an extra "end" on the user_test.rb file that i removed... now works well... I love treehouse

Great! Glad to be of help!

Thanks for the help, but that didn't end up working

Jason Seifer
STAFF
Jason Seifer
Treehouse Guest Teacher

Hey Trevor feel free to zip up your code and email it to help@teamtreehouse.com if you're still having trouble.

hey Jason, I have been stuck on this all day and emailed you my code. I'd love to continue this course!

Jason's fix worked for me, but I don't quite understand why it happened in the first place. It happened after I started trying to "test the full app" project. Thanks.

Jason you the man!! worked for me.