diff options
author | Kuldeep Aggarwal <kd.engineer@yahoo.co.in> | 2013-11-29 18:49:56 +0530 |
---|---|---|
committer | Kuldeep Aggarwal <kd.engineer@yahoo.co.in> | 2013-11-29 18:49:56 +0530 |
commit | 647cff3a134772bc6374b89e95d13497e23b5309 (patch) | |
tree | b82e5ea545bf0792f4276a33cadf38bb3010429d /activerecord/test/cases/associations | |
parent | 948c0ff1647eb3dd1b45add0d1748d393cd2fd50 (diff) | |
download | rails-647cff3a134772bc6374b89e95d13497e23b5309.tar.gz rails-647cff3a134772bc6374b89e95d13497e23b5309.tar.bz2 rails-647cff3a134772bc6374b89e95d13497e23b5309.zip |
updating options documentation for associations
removed unnecessary test case and improved test case for belongs_to having invalid options
Diffstat (limited to 'activerecord/test/cases/associations')
-rw-r--r-- | activerecord/test/cases/associations/belongs_to_associations_test.rb | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/activerecord/test/cases/associations/belongs_to_associations_test.rb b/activerecord/test/cases/associations/belongs_to_associations_test.rb index a79f145e31..7c913bc78b 100644 --- a/activerecord/test/cases/associations/belongs_to_associations_test.rb +++ b/activerecord/test/cases/associations/belongs_to_associations_test.rb @@ -619,16 +619,11 @@ class BelongsToAssociationsTest < ActiveRecord::TestCase assert_equal [author_address.id], AuthorAddress.destroyed_author_address_ids end - def test_invalid_belongs_to_dependent_option_nullify_raises_exception - assert_raise ArgumentError do + def test_belongs_to_invalid_dependent_option_raises_exception + error = assert_raise ArgumentError do Class.new(Author).belongs_to :special_author_address, :dependent => :nullify end - end - - def test_invalid_belongs_to_dependent_option_restrict_raises_exception - assert_raise ArgumentError do - Class.new(Author).belongs_to :special_author_address, :dependent => :restrict - end + assert_equal error.message, 'The :dependent option must be one of [:destroy, :delete], but is :nullify' end def test_attributes_are_being_set_when_initialized_from_belongs_to_association_with_where_clause |