Skip to content

Commit cef7c28

Browse files
committed
[Rails5] Coerice quoting in test.
1 parent 5d30181 commit cef7c28

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

test/cases/coerced_tests.rb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,14 @@ class DatabaseTasksDropAllTest < ActiveRecord::TestCase
254254
class DefaultScopingTest < ActiveRecord::TestCase
255255
# We are not doing order duplicate removal anymore.
256256
coerce_tests! :test_order_in_default_scope_should_not_prevail
257+
258+
# Use our escaped format in assertion.
259+
coerce_tests! :test_with_abstract_class_scope_should_be_executed_in_correct_context
260+
def test_with_abstract_class_scope_should_be_executed_in_correct_context_coerced
261+
vegetarian_pattern, gender_pattern = [/[lions].[is_vegetarian]/, /[lions].[gender]/]
262+
assert_match vegetarian_pattern, Lion.all.to_sql
263+
assert_match gender_pattern, Lion.female.to_sql
264+
end
257265
end
258266

259267

0 commit comments

Comments
 (0)