Skip to content

Commit

Permalink
Remove mocking on save, when not necessary
Browse files Browse the repository at this point in the history
  • Loading branch information
arthurnn committed Mar 11, 2014
1 parent ccaf0ed commit 3c23f76
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions activerecord/test/cases/autosave_association_test.rb
Expand Up @@ -691,14 +691,12 @@ def save(*args)

def test_should_save_changed_has_one_changed_object_if_child_is_saved
@pirate.ship.name = "NewName"
@pirate.ship.expects(:save).once.returns(true)

assert @pirate.save
assert_equal "NewName", @pirate.ship.reload.name
end

def test_should_not_save_changed_has_one_unchanged_object_if_child_is_saved
@pirate.ship.expects(:save).never

assert @pirate.save
end

Expand Down

0 comments on commit 3c23f76

Please sign in to comment.