Skip to content

Updated error message in test to include sqlserver #1176

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions test/cases/coerced_tests.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2635,3 +2635,21 @@ def test_remove_check_constraint_coerced
end
end
end

module ActiveRecord
module ConnectionAdapters
class PoolConfig
class ResolverTest < ActiveRecord::TestCase
# SQL Server was not included in the list of available adapters in the error message.
coerce_tests! :test_url_invalid_adapter
def test_url_invalid_adapter_coerced
error = assert_raises(AdapterNotFound) do
Base.connection_handler.establish_connection "ridiculous://foo?encoding=utf8"
end

assert_match "Database configuration specifies nonexistent 'ridiculous' adapter. Available adapters are: abstract, fake, mysql2, postgresql, sqlite3, sqlserver, trilogy. Ensure that the adapter is spelled correctly in config/database.yml and that you've added the necessary adapter gem to your Gemfile if it's not in the list of available adapters.", error.message
end
end
end
end
end
Loading