spec>models>item_spec.rb
it "imageが空だと登録できない" do
@item.image = ''
@item.valid?
expect(@item.errors.full_messages).to include("Image can't be blank")
end
:エラー文
Failure/Error: expect(@item.errors.full_messages).to include("Image can't be blank")
expected [] to include "Image can't be blank"
# ./spec/models/item_spec.rb:22:in `block (4 levels) in
spec>models>item_spec.rb
it "imageが空だと登録できない" do
@item.image = nil
@item.valid?
expect(@item.errors.full_messages).to include("Image can't be blank")
end
「’’」を「nil」に変えるだけで解決しました。
※ これだけで1〜2時間もエラー解決に時間かかっちゃったよ〜〜〜(泣)