diff options
author | Emilio Tagua <miloops@gmail.com> | 2009-10-05 14:39:20 -0300 |
---|---|---|
committer | Emilio Tagua <miloops@gmail.com> | 2009-10-05 14:39:20 -0300 |
commit | 3747f896a1b727d67e6022001007e5f58b24a267 (patch) | |
tree | 1e72baf5128b9138be87089a4b88c3bab09e5f2c /activerecord/test/cases | |
parent | c01c21b31d590f7e8d12e3ae083fcdf0f0c6fd54 (diff) | |
download | rails-3747f896a1b727d67e6022001007e5f58b24a267.tar.gz rails-3747f896a1b727d67e6022001007e5f58b24a267.tar.bz2 rails-3747f896a1b727d67e6022001007e5f58b24a267.zip |
Moved relation's test to relation_test.
Diffstat (limited to 'activerecord/test/cases')
-rw-r--r-- | activerecord/test/cases/method_scoping_test.rb | 4 | ||||
-rw-r--r-- | activerecord/test/cases/relations_test.rb | 11 |
2 files changed, 13 insertions, 2 deletions
diff --git a/activerecord/test/cases/method_scoping_test.rb b/activerecord/test/cases/method_scoping_test.rb index 6dec474f7d..eb4ce0e774 100644 --- a/activerecord/test/cases/method_scoping_test.rb +++ b/activerecord/test/cases/method_scoping_test.rb @@ -593,12 +593,12 @@ class DefaultScopingTest < ActiveRecord::TestCase end def test_default_scope_with_conditions_string - assert_equal Developer.find_all_by_name('David').map(&:id).sort, DeveloperCalledDavid.all.to_a.map(&:id).sort + assert_equal Developer.find_all_by_name('David').map(&:id).sort, DeveloperCalledDavid.find(:all).map(&:id).sort assert_equal nil, DeveloperCalledDavid.create!.name end def test_default_scope_with_conditions_hash - assert_equal Developer.find_all_by_name('Jamis').map(&:id).sort, DeveloperCalledJamis.all.to_a.map(&:id).sort + assert_equal Developer.find_all_by_name('Jamis').map(&:id).sort, DeveloperCalledJamis.find(:all).map(&:id).sort assert_equal 'Jamis', DeveloperCalledJamis.create!.name end diff --git a/activerecord/test/cases/relations_test.rb b/activerecord/test/cases/relations_test.rb index 6fb505ca36..17c228616b 100644 --- a/activerecord/test/cases/relations_test.rb +++ b/activerecord/test/cases/relations_test.rb @@ -114,5 +114,16 @@ class RelationTest < ActiveRecord::TestCase posts.first.author end end + + def test_default_scope_with_conditions_string + assert_equal Developer.find_all_by_name('David').map(&:id).sort, DeveloperCalledDavid.all.to_a.map(&:id).sort + assert_equal nil, DeveloperCalledDavid.create!.name + end + + def test_default_scope_with_conditions_hash + assert_equal Developer.find_all_by_name('Jamis').map(&:id).sort, DeveloperCalledJamis.all.to_a.map(&:id).sort + assert_equal 'Jamis', DeveloperCalledJamis.create!.name + end + end |