search for: valid_attributes1

Displaying 1 result from an estimated 1 matches for "valid_attributes1".

Did you mean: valid_attributes
2009 Jan 16
3
rspec model testing - test on user defined validation- How do I test that the create failed.
....create!(@valid_attributes) end it "should create a new instance given valid attributes" do MyTest.create!(@valid_attributes) end --------------------------------- Before coding I modified the test file as follows it "should create a new instance given valid attributes" do @valid_attributes1 = { :field1 = "value 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 incompatibl...