aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authorArthur Nogueira Neves <github@arthurnn.com>2015-10-12 15:25:04 -0400
committerArthur Nogueira Neves <github@arthurnn.com>2015-10-12 15:25:04 -0400
commit97cdab0680dfa5856f8ec3dfa85e7fafc7f334ae (patch)
treed721f57f028b76682efe5161af7600a9facdcd1f /activerecord
parent96747036715a658ab21e921919d45d6149949d55 (diff)
parent329642325e6d58676c68816ce61db4ea0e8944d3 (diff)
downloadrails-97cdab0680dfa5856f8ec3dfa85e7fafc7f334ae.tar.gz
rails-97cdab0680dfa5856f8ec3dfa85e7fafc7f334ae.tar.bz2
rails-97cdab0680dfa5856f8ec3dfa85e7fafc7f334ae.zip
Merge pull request #21288 from yahonda/mysql_requires_password
Allow mysql and mysql2 tests run by database user with password
Diffstat (limited to 'activerecord')
-rw-r--r--activerecord/Rakefile8
-rw-r--r--activerecord/test/cases/adapters/mysql/connection_test.rb2
2 files changed, 5 insertions, 5 deletions
diff --git a/activerecord/Rakefile b/activerecord/Rakefile
index 8ea22fd901..c93099a921 100644
--- a/activerecord/Rakefile
+++ b/activerecord/Rakefile
@@ -88,15 +88,15 @@ namespace :db do
desc 'Build the MySQL test databases'
task :build do
config = ARTest.config['connections']['mysql']
- %x( mysql --user=#{config['arunit']['username']} -e "create DATABASE #{config['arunit']['database']} DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_unicode_ci ")
- %x( mysql --user=#{config['arunit2']['username']} -e "create DATABASE #{config['arunit2']['database']} DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_unicode_ci ")
+ %x( mysql --user=#{config['arunit']['username']} --password=#{config['arunit']['password']} -e "create DATABASE #{config['arunit']['database']} DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_unicode_ci ")
+ %x( mysql --user=#{config['arunit2']['username']} --password=#{config['arunit2']['password']} -e "create DATABASE #{config['arunit2']['database']} DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_unicode_ci ")
end
desc 'Drop the MySQL test databases'
task :drop do
config = ARTest.config['connections']['mysql']
- %x( mysqladmin --user=#{config['arunit']['username']} -f drop #{config['arunit']['database']} )
- %x( mysqladmin --user=#{config['arunit2']['username']} -f drop #{config['arunit2']['database']} )
+ %x( mysqladmin --user=#{config['arunit']['username']} --password=#{config['arunit']['password']} -f drop #{config['arunit']['database']} )
+ %x( mysqladmin --user=#{config['arunit2']['username']} --password=#{config['arunit2']['password']} -f drop #{config['arunit2']['database']} )
end
desc 'Rebuild the MySQL test databases'
diff --git a/activerecord/test/cases/adapters/mysql/connection_test.rb b/activerecord/test/cases/adapters/mysql/connection_test.rb
index 8b62998964..5699fa110f 100644
--- a/activerecord/test/cases/adapters/mysql/connection_test.rb
+++ b/activerecord/test/cases/adapters/mysql/connection_test.rb
@@ -26,7 +26,7 @@ class MysqlConnectionTest < ActiveRecord::MysqlTestCase
run_without_connection do
ar_config = ARTest.connection_config['arunit']
- url = "mysql://#{ar_config["username"]}@localhost/#{ar_config["database"]}"
+ url = "mysql://#{ar_config["username"]}:#{ar_config["password"]}@localhost/#{ar_config["database"]}"
Klass.establish_connection(url)
assert_equal ar_config['database'], Klass.connection.current_database
end