Skip to content
Browse files

Refactoring test_has_many_with_pluralize_table_names_false test

  • Loading branch information...
1 parent 6a3b3fb commit 23e94a67f8e922a9ccde7f8b2e6abc56a925d6bf @guilleiguaran guilleiguaran committed May 20, 2011
Showing with 2 additions and 4 deletions.
  1. +1 −4 activerecord/test/cases/associations/join_model_test.rb
  2. +1 −0 activerecord/test/models/aircraft.rb
View
5 activerecord/test/cases/associations/join_model_test.rb
@@ -708,12 +708,9 @@ def test_has_many_through_goes_through_all_sti_classes
end
def test_has_many_with_pluralize_table_names_false
- engine = Engine.create(:car_id => 1)
- Aircraft.pluralize_table_names = false
+ engine = Engine.create!(:car_id => 1)
aircraft = Aircraft.create!(:name => "Airbus 380", :id => 1)
assert_equal aircraft.engines, [engine]
- ensure
- ActiveRecord::Base.pluralize_table_names = true
end
private
View
1 activerecord/test/models/aircraft.rb
@@ -1,3 +1,4 @@
class Aircraft < ActiveRecord::Base
+ self.pluralize_table_names = false
has_many :engines, :foreign_key => "car_id"
end

0 comments on commit 23e94a6

Please sign in to comment.
Something went wrong with that request. Please try again.