Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ActiveRecord::StatementInvalid: Could not find table

Tags:

I am trying to run users_test.rb file which just has

test "the truth" do      assert true    end 

I do have a likes table, still I am getting this error. Why so?

Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed. ➜  channelappnew  rake db:test:clone ➜  channelappnew  rake db:test:clone_structure ➜  channelappnew  rake db:migrate ➜  channelappnew  rake db:test:load ➜  channelappnew  rake db:test:prepare ➜  channelappnew  rake db:test:purge ➜  channelappnew  ruby -Itest test/unit/user_test.rb Loaded suite test/unit/user_test Started E  Error: test_the_truth(UserTest): ActiveRecord::StatementInvalid: Could not find table 'likes'     Finished in 0.058371 seconds.  1 tests, 0 assertions, 0 failures, 1 errors, 0 pendings, 0 omissions, 0 notifications 0% passed  17.13 tests/s, 0.00 assertions/s 

Thanks!

like image 546
Ava Avatar asked Oct 01 '11 02:10

Ava


1 Answers

before test do rake db:test:prepare

like image 174
Hassan Avatar answered Sep 28 '22 10:09

Hassan