Skip to content

Commit 422cb68

Browse files
committed
remove unnecesary coercion
1 parent eac1dbb commit 422cb68

File tree

1 file changed

+0
-42
lines changed

1 file changed

+0
-42
lines changed

test/cases/coerced_tests.rb

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1851,48 +1851,6 @@ class ReloadModelsTest < ActiveRecord::TestCase
18511851
coerce_tests! :test_has_one_with_reload if RbConfig::CONFIG["host_os"] =~ /mswin|mingw/
18521852
end
18531853

1854-
require "models/post"
1855-
class AnnotateTest < ActiveRecord::TestCase
1856-
# Same as original coerced test except our SQL starts with `EXEC sp_executesql`.
1857-
# TODO: Remove coerce after Rails 7 (see https://github.com/rails/rails/pull/42027)
1858-
coerce_tests! :test_annotate_wraps_content_in_an_inline_comment
1859-
def test_annotate_wraps_content_in_an_inline_comment_coerced
1860-
quoted_posts_id, quoted_posts = regexp_escape_table_name("posts.id"), regexp_escape_table_name("posts")
1861-
1862-
assert_sql(%r{SELECT #{quoted_posts_id} FROM #{quoted_posts} /\* foo \*/}i) do
1863-
posts = Post.select(:id).annotate("foo")
1864-
assert posts.first
1865-
end
1866-
end
1867-
1868-
# Same as original coerced test except our SQL starts with `EXEC sp_executesql`.
1869-
# TODO: Remove coerce after Rails 7 (see https://github.com/rails/rails/pull/42027)
1870-
coerce_tests! :test_annotate_is_sanitized
1871-
def test_annotate_is_sanitized_coerced
1872-
quoted_posts_id, quoted_posts = regexp_escape_table_name("posts.id"), regexp_escape_table_name("posts")
1873-
1874-
assert_sql(%r{SELECT #{quoted_posts_id} FROM #{quoted_posts} /\* foo \*/}i) do
1875-
posts = Post.select(:id).annotate("*/foo/*")
1876-
assert posts.first
1877-
end
1878-
1879-
assert_sql(%r{SELECT #{quoted_posts_id} FROM #{quoted_posts} /\* foo \*/}i) do
1880-
posts = Post.select(:id).annotate("**//foo//**")
1881-
assert posts.first
1882-
end
1883-
1884-
assert_sql(%r{SELECT #{quoted_posts_id} FROM #{quoted_posts} /\* foo \*/ /\* bar \*/}i) do
1885-
posts = Post.select(:id).annotate("*/foo/*").annotate("*/bar")
1886-
assert posts.first
1887-
end
1888-
1889-
assert_sql(%r{SELECT #{quoted_posts_id} FROM #{quoted_posts} /\* \+ MAX_EXECUTION_TIME\(1\) \*/}i) do
1890-
posts = Post.select(:id).annotate("+ MAX_EXECUTION_TIME(1)")
1891-
assert posts.first
1892-
end
1893-
end
1894-
end
1895-
18961854
class MarshalSerializationTest < ActiveRecord::TestCase
18971855
private
18981856

0 commit comments

Comments
 (0)