Ava*_*Ava 21 unit-testing ruby-on-rails rubymine
我正在尝试运行users_test.rb刚刚拥有的文件
test "the truth" do
assert true
end
Run Code Online (Sandbox Code Playgroud)
我确实有一个喜欢的桌子,我仍然得到这个错误.为什么这样?
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
Run Code Online (Sandbox Code Playgroud)
谢谢!
你跑了rake db:migrate吗?如果表存在,请检查数据库.如果您正在使用sqlite,则调用sqlite3 db/development.sqlite3然后发出命令.schema
您可以手动删除数据库db/test.sqlite3,然后重新创建它rake db:setup.