From 9a25315076bf90c39ab5471fa8d81736a3b2478e Mon Sep 17 00:00:00 2001 From: Pratik Naik Date: Sat, 28 Jun 2008 01:57:32 +0100 Subject: Add extra hash conditions tests for named_scope --- activerecord/test/cases/named_scope_test.rb | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'activerecord/test/cases') diff --git a/activerecord/test/cases/named_scope_test.rb b/activerecord/test/cases/named_scope_test.rb index 393ba086c9..7d73541ee1 100644 --- a/activerecord/test/cases/named_scope_test.rb +++ b/activerecord/test/cases/named_scope_test.rb @@ -65,6 +65,10 @@ class NamedScopeTest < ActiveRecord::TestCase assert_equal Topic.replied.approved, Topic.replied.approved_as_string end + def test_scopes_can_be_specified_with_deep_hash_conditions + assert_equal Topic.replied.approved, Topic.replied.approved_as_hash_condition + end + def test_scopes_are_composable assert_equal (approved = Topic.find(:all, :conditions => {:approved => true})), Topic.approved assert_equal (replied = Topic.find(:all, :conditions => 'replies_count > 0')), Topic.replied -- cgit v1.2.3