aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/autosave_association_test.rb
diff options
context:
space:
mode:
authorJon Leighton <j@jonathanleighton.com>2011-02-21 01:09:41 +0000
committerAaron Patterson <aaron.patterson@gmail.com>2011-02-21 10:16:15 -0800
commit52f8e4b9dae6137fcd95793dffc26ddff80b623e (patch)
tree11a80259a618472810155ca46fd826246aab9906 /activerecord/test/cases/autosave_association_test.rb
parenta5274bb52c058bae69476bee3c95f472513a5725 (diff)
downloadrails-52f8e4b9dae6137fcd95793dffc26ddff80b623e.tar.gz
rails-52f8e4b9dae6137fcd95793dffc26ddff80b623e.tar.bz2
rails-52f8e4b9dae6137fcd95793dffc26ddff80b623e.zip
Use proper objects to do the work to build the associations (adding methods, callbacks etc) rather than calling a whole bunch of methods with rather long names.
Diffstat (limited to 'activerecord/test/cases/autosave_association_test.rb')
-rw-r--r--activerecord/test/cases/autosave_association_test.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/activerecord/test/cases/autosave_association_test.rb b/activerecord/test/cases/autosave_association_test.rb
index dbc5d71153..b9d9d89220 100644
--- a/activerecord/test/cases/autosave_association_test.rb
+++ b/activerecord/test/cases/autosave_association_test.rb
@@ -21,19 +21,19 @@ require 'models/eye'
class TestAutosaveAssociationsInGeneral < ActiveRecord::TestCase
def test_autosave_should_be_a_valid_option_for_has_one
- assert base.valid_keys_for_has_one_association.include?(:autosave)
+ assert ActiveRecord::Associations::Builder::HasOne.valid_options.include?(:autosave)
end
def test_autosave_should_be_a_valid_option_for_belongs_to
- assert base.valid_keys_for_belongs_to_association.include?(:autosave)
+ assert ActiveRecord::Associations::Builder::BelongsTo.valid_options.include?(:autosave)
end
def test_autosave_should_be_a_valid_option_for_has_many
- assert base.valid_keys_for_has_many_association.include?(:autosave)
+ assert ActiveRecord::Associations::Builder::HasMany.valid_options.include?(:autosave)
end
def test_autosave_should_be_a_valid_option_for_has_and_belongs_to_many
- assert base.valid_keys_for_has_and_belongs_to_many_association.include?(:autosave)
+ assert ActiveRecord::Associations::Builder::HasAndBelongsToMany.valid_options.include?(:autosave)
end
def test_should_not_add_the_same_callbacks_multiple_times_for_has_one