diff options
author | Emilio Tagua <miloops@gmail.com> | 2009-08-10 18:19:24 -0300 |
---|---|---|
committer | Emilio Tagua <miloops@gmail.com> | 2009-08-10 18:19:24 -0300 |
commit | 10af9fae4a66f5f80c89ba75009cc7c7c9935a44 (patch) | |
tree | 82d77efb6addd6f4f672e4d9659c3141904e923e /activerecord/test | |
parent | 0e2fbd80e2420329738b891240d44a056cea1de4 (diff) | |
parent | d0f891ae0215d7963b3918f3847ee4c015a6b90c (diff) | |
download | rails-10af9fae4a66f5f80c89ba75009cc7c7c9935a44.tar.gz rails-10af9fae4a66f5f80c89ba75009cc7c7c9935a44.tar.bz2 rails-10af9fae4a66f5f80c89ba75009cc7c7c9935a44.zip |
Merge commit 'rails/master'
Diffstat (limited to 'activerecord/test')
-rw-r--r-- | activerecord/test/cases/associations/has_many_through_associations_test.rb | 20 | ||||
-rw-r--r-- | activerecord/test/cases/validations/uniqueness_validation_test.rb | 2 |
2 files changed, 9 insertions, 13 deletions
diff --git a/activerecord/test/cases/associations/has_many_through_associations_test.rb b/activerecord/test/cases/associations/has_many_through_associations_test.rb index 59985374d3..a9d4d88148 100644 --- a/activerecord/test/cases/associations/has_many_through_associations_test.rb +++ b/activerecord/test/cases/associations/has_many_through_associations_test.rb @@ -180,27 +180,23 @@ class HasManyThroughAssociationsTest < ActiveRecord::TestCase end def test_associate_with_create_and_invalid_options - peeps = companies(:first_firm).developers.count - assert_nothing_raised { companies(:first_firm).developers.create(:name => '0') } - assert_equal peeps, companies(:first_firm).developers.count + firm = companies(:first_firm) + assert_no_difference('firm.developers.count') { assert_nothing_raised { firm.developers.create(:name => '0') } } end def test_associate_with_create_and_valid_options - peeps = companies(:first_firm).developers.count - assert_nothing_raised { companies(:first_firm).developers.create(:name => 'developer') } - assert_equal peeps + 1, companies(:first_firm).developers.count + firm = companies(:first_firm) + assert_difference('firm.developers.count', 1) { firm.developers.create(:name => 'developer') } end def test_associate_with_create_bang_and_invalid_options - peeps = companies(:first_firm).developers.count - assert_raises(ActiveRecord::RecordInvalid) { companies(:first_firm).developers.create!(:name => '0') } - assert_equal peeps, companies(:first_firm).developers.count + firm = companies(:first_firm) + assert_no_difference('firm.developers.count') { assert_raises(ActiveRecord::RecordInvalid) { firm.developers.create!(:name => '0') } } end def test_associate_with_create_bang_and_valid_options - peeps = companies(:first_firm).developers.count - assert_nothing_raised { companies(:first_firm).developers.create!(:name => 'developer') } - assert_equal peeps + 1, companies(:first_firm).developers.count + firm = companies(:first_firm) + assert_difference('firm.developers.count', 1) { firm.developers.create!(:name => 'developer') } end def test_clear_associations diff --git a/activerecord/test/cases/validations/uniqueness_validation_test.rb b/activerecord/test/cases/validations/uniqueness_validation_test.rb index cb123d3498..17ba4e2f8a 100644 --- a/activerecord/test/cases/validations/uniqueness_validation_test.rb +++ b/activerecord/test/cases/validations/uniqueness_validation_test.rb @@ -59,7 +59,7 @@ class UniquenessValidationTest < ActiveRecord::TestCase assert t2.save, "Should now save t2 as unique" end - def test_validates_uniquness_with_newline_chars + def test_validates_uniqueness_with_newline_chars Topic.validates_uniqueness_of(:title, :case_sensitive => false) t = Topic.new("title" => "new\nline") |