Michael Hartlのrailstutorialの第11章を読んでいて、いくつかのrspecエラーが発生しました。
エラーメッセージが何を意味するのかよくわかりません。
念のため、これが私のスペックコードです。
let(:follower) {FactoryGirl.create(:user)}
let(:followed) {FactoryGirl.create(:user)}
let(:relationship) {follower.relationships.build(followed_id: followed_id)}
subject {relationship}
it {should be_valid}
describe "accessible attributes" do
it "should not allow access to follower_id" do
expect do
Relationship.new(follower_id: follower_id)
end.to raise_error(ActiveModel::MassAssignmentSecurity::Error)
end
end
どんな助けでもいただければ幸いです。ありがとう!