diff --git a/test/cases/has_many_test.rb b/test/cases/has_many_test.rb index dfbf9cc..472824e 100644 --- a/test/cases/has_many_test.rb +++ b/test/cases/has_many_test.rb @@ -9,13 +9,13 @@ class GroupedScope::HasManyTest < GroupedScope::TestCase end it 'scopes existing association to owner' do - assert_sql(/"employee_id" = #{@employee.id}/) do + assert_sql(/"employee_id" = \?/) do @employee.reports(true) end end it 'scopes group association to owner when no group present' do - assert_sql(/"employee_id" = #{@employee.id}/) do + assert_sql(/"employee_id" = \?/) do @employee.group.reports(true) end end @@ -35,7 +35,7 @@ class GroupedScope::HasManyTest < GroupedScope::TestCase end it 'scope count sql to owner' do - assert_sql(/SELECT COUNT\(\*\)/,/"employee_id" = #{@e1.id}/) do + assert_sql(/SELECT COUNT\(\*\)/,/"employee_id" = \?/) do @e1.reports(true).count end end @@ -112,13 +112,13 @@ class GroupedScope::HasManyTest < GroupedScope::TestCase end it 'scope existing association to owner' do - assert_sql(/"legacy_reports"."email" = '#{@employee.id}'/) do + assert_sql(/"legacy_reports"."email" = \?/) do @employee.reports(true) end end it 'scope group association to owner, since no group is present' do - assert_sql(/"legacy_reports"."email" = '#{@employee.id}'/) do + assert_sql(/"legacy_reports"."email" = \?/) do @employee.group.reports(true) end end diff --git a/test/cases/has_many_through_test.rb b/test/cases/has_many_through_test.rb index fc55859..6d0097a 100644 --- a/test/cases/has_many_through_test.rb +++ b/test/cases/has_many_through_test.rb @@ -13,13 +13,13 @@ class GroupedScope::HasManyThroughTest < GroupedScope::TestCase describe 'For default association' do it 'scope to owner' do - assert_sql(/"employee_id" = #{@e1.id}/) do + assert_sql(/"employee_id" = \?/) do @e1.departments(true) end end it 'scope count to owner' do - assert_sql(/"employee_id" = #{@e1.id}/) do + assert_sql(/"employee_id" = \?/) do @e1.departments(true).count end end