diff options
author | Guillermo Iguaran <guilleiguaran@gmail.com> | 2013-12-21 22:53:05 -0800 |
---|---|---|
committer | Guillermo Iguaran <guilleiguaran@gmail.com> | 2013-12-21 22:53:05 -0800 |
commit | 6f4a556bf51f70090000a18b82ee4fe60730c6b2 (patch) | |
tree | 3a0ccd5993217f01cb21fef58ef66cfaadaeb546 /railties/test/commands/dbconsole_test.rb | |
parent | 6d255b741c688671716f50008b8f0c86aab052cf (diff) | |
parent | dd93a5f4598b420710fb4a9a2628abfd98799fb6 (diff) | |
download | rails-6f4a556bf51f70090000a18b82ee4fe60730c6b2.tar.gz rails-6f4a556bf51f70090000a18b82ee4fe60730c6b2.tar.bz2 rails-6f4a556bf51f70090000a18b82ee4fe60730c6b2.zip |
Merge pull request #13443 from schneems/schneems/fix-master-tests
Fix DB Console tests
Diffstat (limited to 'railties/test/commands/dbconsole_test.rb')
-rw-r--r-- | railties/test/commands/dbconsole_test.rb | 42 |
1 files changed, 22 insertions, 20 deletions
diff --git a/railties/test/commands/dbconsole_test.rb b/railties/test/commands/dbconsole_test.rb index a6cd6ec61d..7ad83a8b5d 100644 --- a/railties/test/commands/dbconsole_test.rb +++ b/railties/test/commands/dbconsole_test.rb @@ -38,36 +38,38 @@ class Rails::DBConsoleTest < ActiveSupport::TestCase end def test_config_with_database_url_only - ENV['DATABASE_URL'] = 'sqlite3://foo:bar@localhost:9000/foo_test?pool=5&timeout=3000' + ENV['DATABASE_URL'] = 'postgresql://foo:bar@localhost:9000/foo_test?pool=5&timeout=3000' app_db_config(nil) - assert_equal Rails::DBConsole.new.config.sort, { - "adapter"=> "sqlite3", - "host"=> "localhost", - "port"=> 9000, - "database"=> "foo_test", - "username"=> "foo", - "password"=> "bar", - "pool"=> "5", - "timeout"=> "3000" + expected = { + "adapter" => "postgresql", + "host" => "localhost", + "port" => 9000, + "database" => "foo_test", + "username" => "foo", + "password" => "bar", + "pool" => "5", + "timeout" => "3000" }.sort + assert_equal expected, Rails::DBConsole.new.config.sort end def test_config_choose_database_url_if_exists - ENV['DATABASE_URL'] = 'sqlite3://foo:bar@dburl:9000/foo_test?pool=5&timeout=3000' + host = "database-url-host.com" + ENV['DATABASE_URL'] = "postgresql://foo:bar@#{host}:9000/foo_test?pool=5&timeout=3000" sample_config = { "test" => { - "adapter"=> "sqlite3", - "host"=> "localhost", - "port"=> 9000, - "database"=> "foo_test", - "username"=> "foo", - "password"=> "bar", - "pool"=> "5", - "timeout"=> "3000" + "adapter" => "postgresql", + "host" => "not-the-#{host}", + "port" => 9000, + "database" => "foo_test", + "username" => "foo", + "password" => "bar", + "pool" => "5", + "timeout" => "3000" } } app_db_config(sample_config) - assert_equal Rails::DBConsole.new.config["host"], "dburl" + assert_equal host, Rails::DBConsole.new.config["host"] end def test_env |