aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2010-11-29 13:32:02 -0800
committerAaron Patterson <aaron.patterson@gmail.com>2010-11-29 13:32:02 -0800
commit9f2e885ce8d5cbf6999b22e274ec245d9007131d (patch)
tree1897c1538761c40687e71fdbe47222a0f19c8f65 /activerecord
parentaae3c3538492f19f1c4e1fcfe6c942ff72a30ce1 (diff)
downloadrails-9f2e885ce8d5cbf6999b22e274ec245d9007131d.tar.gz
rails-9f2e885ce8d5cbf6999b22e274ec245d9007131d.tar.bz2
rails-9f2e885ce8d5cbf6999b22e274ec245d9007131d.zip
testing attributes applied by default_scope
Diffstat (limited to 'activerecord')
-rw-r--r--activerecord/test/cases/relation_scoping_test.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/activerecord/test/cases/relation_scoping_test.rb b/activerecord/test/cases/relation_scoping_test.rb
index dae9721a63..c7f7738248 100644
--- a/activerecord/test/cases/relation_scoping_test.rb
+++ b/activerecord/test/cases/relation_scoping_test.rb
@@ -464,6 +464,11 @@ class DefaultScopingTest < ActiveRecord::TestCase
assert_equal 50000, PoorDeveloperCalledJamis.create!(:name => 'David').salary
end
+ def test_default_scope_attribute
+ jamis = PoorDeveloperCalledJamis.new(:name => 'David')
+ assert_equal 50000, jamis.salary
+ 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)