mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Cleanup Parrot after each test.
This commit is contained in:
parent
740862a202
commit
5ade4b0593
1 changed files with 3 additions and 7 deletions
|
@ -64,10 +64,6 @@ class TestAutosaveAssociationsInGeneral < ActiveRecord::TestCase
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
def base
|
|
||||||
ActiveRecord::Base
|
|
||||||
end
|
|
||||||
|
|
||||||
def assert_no_difference_when_adding_callbacks_twice_for(model, association_name)
|
def assert_no_difference_when_adding_callbacks_twice_for(model, association_name)
|
||||||
reflection = model.reflect_on_association(association_name)
|
reflection = model.reflect_on_association(association_name)
|
||||||
assert_no_difference "callbacks_for_model(#{model.name}).length" do
|
assert_no_difference "callbacks_for_model(#{model.name}).length" do
|
||||||
|
@ -622,15 +618,15 @@ end
|
||||||
class TestDestroyAsPartOfAutosaveAssociation < ActiveRecord::TestCase
|
class TestDestroyAsPartOfAutosaveAssociation < ActiveRecord::TestCase
|
||||||
self.use_transactional_fixtures = false
|
self.use_transactional_fixtures = false
|
||||||
|
|
||||||
def setup
|
setup do
|
||||||
super
|
|
||||||
@pirate = Pirate.create(:catchphrase => "Don' botharrr talkin' like one, savvy?")
|
@pirate = Pirate.create(:catchphrase => "Don' botharrr talkin' like one, savvy?")
|
||||||
@ship = @pirate.create_ship(:name => 'Nights Dirty Lightning')
|
@ship = @pirate.create_ship(:name => 'Nights Dirty Lightning')
|
||||||
end
|
end
|
||||||
|
|
||||||
def teardown
|
teardown do
|
||||||
# We are running without transactional fixtures and need to cleanup.
|
# We are running without transactional fixtures and need to cleanup.
|
||||||
Bird.delete_all
|
Bird.delete_all
|
||||||
|
Parrot.delete_all
|
||||||
@ship.delete
|
@ship.delete
|
||||||
@pirate.delete
|
@pirate.delete
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue