この仕様を記述するより良い方法はありますか? これは機能しますがf.valid?
、 f.errors を取得するために呼び出す必要があるという事実は好きではありません。
it "fails to save the record because the name is blank" do
f = Foo.new
f.valid?
f.errors.include?(:name).should be_true
end
この仕様を記述するより良い方法はありますか? これは機能しますがf.valid?
、 f.errors を取得するために呼び出す必要があるという事実は好きではありません。
it "fails to save the record because the name is blank" do
f = Foo.new
f.valid?
f.errors.include?(:name).should be_true
end