を実行した後でも、次のエラーが表示されますrake db:test:prepare
。私はRails 4.0を実行しています。
1) Core::PostsController GET index assigns all posts as @posts
Failure/Error: post = Post.create! valid_attributes
ActiveRecord::StatementInvalid:
Could not find table 'core_posts'
# ./spec/controllers/core/posts_controller_spec.rb:36:in `block (3 levels) in <module:Core>'
このテストをエンジン内で実行しているので、何か関連があるのでしょうか? 私のテストは次のようになります。
module Core
describe PostsController do
# This should return the minimal set of attributes required to create a valid
# Post. As you add validations to Post, be sure to
# adjust the attributes here as well.
let(:valid_attributes) { { } }
# This should return the minimal set of values that should be in the session
# in order to pass any filters (e.g. authentication) defined in
# PostsController. Be sure to keep this updated too.
let(:valid_session) { {} }
describe "GET index" do
it "assigns all posts as @posts" do
post = Post.create! valid_attributes
get :index, {}, valid_session
assigns(:posts).should eq([post])
end
end
end
end
何か案は?ありがとう!