aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2010-11-29 16:41:02 -0800
committerAaron Patterson <aaron.patterson@gmail.com>2010-11-29 16:41:02 -0800
commit76a15dd0599779f86bda063bb545bba68c6ff17b (patch)
treee7b1aa38c4091f29a3da9305e24d8b38696bcafc /activerecord
parent9f2e885ce8d5cbf6999b22e274ec245d9007131d (diff)
downloadrails-76a15dd0599779f86bda063bb545bba68c6ff17b.tar.gz
rails-76a15dd0599779f86bda063bb545bba68c6ff17b.tar.bz2
rails-76a15dd0599779f86bda063bb545bba68c6ff17b.zip
adding more tests surrounding where values hash
Diffstat (limited to 'activerecord')
-rw-r--r--activerecord/test/cases/relation_scoping_test.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/activerecord/test/cases/relation_scoping_test.rb b/activerecord/test/cases/relation_scoping_test.rb
index c7f7738248..1678e631e5 100644
--- a/activerecord/test/cases/relation_scoping_test.rb
+++ b/activerecord/test/cases/relation_scoping_test.rb
@@ -469,6 +469,17 @@ class DefaultScopingTest < ActiveRecord::TestCase
assert_equal 50000, jamis.salary
end
+ def test_where_attribute
+ aaron = PoorDeveloperCalledJamis.where(:salary => 20).new(:name => 'Aaron')
+ assert_equal 20, aaron.salary
+ assert_equal 'Aaron', aaron.name
+ end
+
+ def test_where_attribute_merge
+ aaron = PoorDeveloperCalledJamis.where(:name => 'foo').new(:name => 'Aaron')
+ assert_equal 'Aaron', aaron.name
+ end
+
def test_scope_composed_by_limit_and_then_offset_is_equal_to_scope_composed_by_offset_and_then_limit
posts_limit_offset = Post.limit(3).offset(2)
posts_offset_limit = Post.offset(2).limit(3)