aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test
diff options
context:
space:
mode:
authorJan De Poorter <jan@defv.be>2008-08-25 12:37:34 +0200
committerPratik Naik <pratiknaik@gmail.com>2008-08-29 14:06:37 +0100
commitdb116a2ed688d36570f412a42e9fc33dcbca56c7 (patch)
tree2f2623fc889af731135efbc06371db59ba9cc27c /activerecord/test
parent6577942b61b98e3bca54c0af3df57f8334b832b9 (diff)
downloadrails-db116a2ed688d36570f412a42e9fc33dcbca56c7.tar.gz
rails-db116a2ed688d36570f412a42e9fc33dcbca56c7.tar.bz2
rails-db116a2ed688d36570f412a42e9fc33dcbca56c7.zip
Fix NamedScope regex so methods containing "an" get delegated to proxy_found. [#901 state:resolved]
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
Diffstat (limited to 'activerecord/test')
-rw-r--r--activerecord/test/cases/named_scope_test.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/activerecord/test/cases/named_scope_test.rb b/activerecord/test/cases/named_scope_test.rb
index 6f6ea1cbe9..4fe7f4f5b9 100644
--- a/activerecord/test/cases/named_scope_test.rb
+++ b/activerecord/test/cases/named_scope_test.rb
@@ -249,6 +249,10 @@ class NamedScopeTest < ActiveRecord::TestCase
assert_equal Topic.base.select(&:approved), Topic.base.find_all(&:approved)
end
+ def test_rand_should_select_a_random_object_from_proxy
+ assert Topic.approved.rand.is_a? Topic
+ end
+
def test_should_use_where_in_query_for_named_scope
assert_equal Developer.find_all_by_name('Jamis'), Developer.find_all_by_id(Developer.jamises)
end