Displaying 1 result from an estimated 1 matches for "invalid_attributes".
Did you mean:
invalid_attributes1
2009 Jan 16
3
rspec model testing - test on user defined validation- How do I test that the create failed.
...for field1"
:field2 = nil
}
MyTest.create!(@valid_attributes1)
@valid_attributes2 = {
:field1 = nil
:field2 = "value for field2"
}
MyTest.create!(@valid_attributes2)
end
it "should not create a new instance given incompatible attribute values" do
@invalid_attributes1 = {
:field1 = "value for field1"
:field2 = "value for field2"
}
MyTest.create!(@invalid_attributes) # I don''t know how to test that the
save failed!!
end
naturally the first two test failed and the last one as written didn''t.
after coding my v...