私のクラス
class Review
include MongoMapper::EmbeddedDocument
key :user_name, String, :require => true
key :user_avatar, String, :require => true
end
Rspec コード
it "when user name is not present" do
blank = FactoryGirl.build(:review, user_name: nil)
blank.should_not be_valid
end
なぜこのエラーが発生するのですか?
1) Review when user name is not present
Failure/Error: blank.should_not be_valid
expected #<Review _id: BSON::ObjectId('5236d401ebe86612fe000006'), user_avatar: "#<Avatar:0xb60083c>")> not to be valid