Skip to content

Commit

Permalink
Merge pull request #14332 from tgxworld/autosave_association_test
Browse files Browse the repository at this point in the history
Delete instances of Parrot after each test.
  • Loading branch information
senny committed Mar 10, 2014
2 parents 740862a + 5ade4b0 commit ed9a69a
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions activerecord/test/cases/autosave_association_test.rb
Expand Up @@ -64,10 +64,6 @@ def test_should_not_add_the_same_callbacks_multiple_times_for_has_and_belongs_to

private

def base
ActiveRecord::Base
end

def assert_no_difference_when_adding_callbacks_twice_for(model, association_name)
reflection = model.reflect_on_association(association_name)
assert_no_difference "callbacks_for_model(#{model.name}).length" do
Expand Down Expand Up @@ -622,15 +618,15 @@ def test_autosave_new_record_on_has_many_can_be_disabled_per_relationship
class TestDestroyAsPartOfAutosaveAssociation < ActiveRecord::TestCase
self.use_transactional_fixtures = false

def setup
super
setup do
@pirate = Pirate.create(:catchphrase => "Don' botharrr talkin' like one, savvy?")
@ship = @pirate.create_ship(:name => 'Nights Dirty Lightning')
end

def teardown
teardown do
# We are running without transactional fixtures and need to cleanup.
Bird.delete_all
Parrot.delete_all
@ship.delete
@pirate.delete
end
Expand Down

0 comments on commit ed9a69a

Please sign in to comment.