@@ -531,7 +531,7 @@ def test_attributes_are_being_set_when_initialized_from_has_one_association_with
531
531
assert_equal "Account" , new_account . firm_name
532
532
end
533
533
534
- def test_create_association_replaces_existing_without_dependent_option
534
+ def test_creation_failure_replaces_existing_without_dependent_option
535
535
pirate = pirates ( :blackbeard )
536
536
orig_ship = pirate . ship
537
537
@@ -540,16 +540,18 @@ def test_create_association_replaces_existing_without_dependent_option
540
540
assert_not_equal ships ( :black_pearl ) , new_ship
541
541
assert_equal new_ship , pirate . ship
542
542
assert_predicate new_ship , :new_record?
543
+ assert_predicate new_ship , :invalid?
543
544
assert_nil orig_ship . pirate_id
544
545
assert_not orig_ship . changed? # check it was saved
545
546
end
546
547
547
- def test_create_association_replaces_existing_with_dependent_option
548
+ def test_creation_failure_replaces_existing_with_dependent_option
548
549
pirate = pirates ( :blackbeard ) . becomes ( DestructivePirate )
549
550
orig_ship = pirate . dependent_ship
550
551
551
552
new_ship = pirate . create_dependent_ship
552
553
assert_predicate new_ship , :new_record?
554
+ assert_predicate new_ship , :invalid?
553
555
assert_predicate orig_ship , :destroyed?
554
556
end
555
557
0 commit comments