Skip to content

Commit

Permalink
Test no longer need to be coerced
Browse files Browse the repository at this point in the history
  • Loading branch information
aidanharan committed Sep 14, 2023
1 parent 4e9ad8a commit 38e3cff
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions test/cases/coerced_tests.rb
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,7 @@ def test_errors_when_an_insert_query_prefixed_by_a_double_dash_comment_is_called
def test_doesnt_error_when_a_select_query_has_encoding_errors_coerced
ActiveRecord::Base.while_preventing_writes do
# TinyTDS fail on encoding errors.
# But at least we can assert it fails in the client and not before when trying to
# match the query.
# But at least we can assert it fails in the client and not before when trying to match the query.
assert_raises ActiveRecord::StatementInvalid do
@connection.select_all("SELECT '\xC8'")
end
Expand Down Expand Up @@ -1396,15 +1395,6 @@ def test_does_not_duplicate_optimizer_hints_on_merge_coerced
query = Post.optimizer_hints("OMGHINT").merge(Post.optimizer_hints("OMGHINT")).to_sql
assert_equal expected, query
end

# Workaround for randomly failing test. Ordering of results not guaranteed.
# TODO: Remove coerced test when https://github.com/rails/rails/pull/44168 merged.
coerce_tests! :test_select_quotes_when_using_from_clause
def test_select_quotes_when_using_from_clause_coerced
quoted_join = ActiveRecord::Base.connection.quote_table_name("join")
selected = Post.select(:join).from(Post.select("id as #{quoted_join}")).map(&:join)
assert_equal Post.pluck(:id).sort, selected.sort
end
end
end

Expand Down

0 comments on commit 38e3cff

Please sign in to comment.