From 9c438e998a954d0923352b8c73b9d751fff139f4 Mon Sep 17 00:00:00 2001 From: Ken Collins Date: Sun, 28 Sep 2008 21:21:36 -0400 Subject: [PATCH] Better SQL regex for testing named scopes can be tagged onto group assocation. --- test/grouped_scope/has_many_association_test.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/grouped_scope/has_many_association_test.rb b/test/grouped_scope/has_many_association_test.rb index 29991f9..09fe390 100644 --- a/test/grouped_scope/has_many_association_test.rb +++ b/test/grouped_scope/has_many_association_test.rb @@ -67,8 +67,9 @@ def setup end should 'use assoc extension SQL along with group reflection' do - assert_sql(/'URGENT'/,/"?reports"?.employee_id IN/) do - @e2.group.reports(true).urgent + sql_regex = /SELECT \* FROM "?reports"? *WHERE \("?reports"?.employee_id IN \(2,3\) AND \("?reports"?."?title"? = 'URGENT'\)\)/ + assert_sql(sql_regex) do + @e2.group.reports.urgent end end