aboutsummaryrefslogtreecommitdiffstats
path: root/railties
diff options
context:
space:
mode:
Diffstat (limited to 'railties')
-rw-r--r--railties/lib/rails/generators/rails/app/templates/config/databases/sqlite3.yml6
-rw-r--r--railties/test/application/initializers/frameworks_test.rb4
-rw-r--r--railties/test/application/rake/dbs_test.rb4
3 files changed, 8 insertions, 6 deletions
diff --git a/railties/lib/rails/generators/rails/app/templates/config/databases/sqlite3.yml b/railties/lib/rails/generators/rails/app/templates/config/databases/sqlite3.yml
index 7312ddb6cd..71934bb48c 100644
--- a/railties/lib/rails/generators/rails/app/templates/config/databases/sqlite3.yml
+++ b/railties/lib/rails/generators/rails/app/templates/config/databases/sqlite3.yml
@@ -23,8 +23,10 @@ test:
# Do not keep production credentials in the repository,
# instead read the configuration from the environment.
#
-# Example:
-# sqlite3://myuser:mypass@localhost/full/path/to/somedatabase
+# Examples:
+# sqlite3::memory:
+# sqlite3:db/production.sqlite3
+# sqlite3:/full/path/to/database.sqlite3
#
production:
url: <%%= ENV["DATABASE_URL"] %>
diff --git a/railties/test/application/initializers/frameworks_test.rb b/railties/test/application/initializers/frameworks_test.rb
index 3601a58f67..8e76bf27f3 100644
--- a/railties/test/application/initializers/frameworks_test.rb
+++ b/railties/test/application/initializers/frameworks_test.rb
@@ -216,8 +216,8 @@ module ApplicationTests
require "#{app_path}/config/environment"
orig_database_url = ENV.delete("DATABASE_URL")
orig_rails_env, Rails.env = Rails.env, 'development'
- database_url_db_name = File.join(app_path, "db/database_url_db.sqlite3")
- ENV["DATABASE_URL"] = "sqlite3://:@localhost/#{database_url_db_name}"
+ database_url_db_name = "db/database_url_db.sqlite3"
+ ENV["DATABASE_URL"] = "sqlite3:#{database_url_db_name}"
ActiveRecord::Base.establish_connection
assert ActiveRecord::Base.connection
assert_match(/#{database_url_db_name}/, ActiveRecord::Base.connection_config[:database])
diff --git a/railties/test/application/rake/dbs_test.rb b/railties/test/application/rake/dbs_test.rb
index b2c52a092f..15414db00f 100644
--- a/railties/test/application/rake/dbs_test.rb
+++ b/railties/test/application/rake/dbs_test.rb
@@ -17,11 +17,11 @@ module ApplicationTests
end
def database_url_db_name
- File.join(app_path, "db/database_url_db.sqlite3")
+ "db/database_url_db.sqlite3"
end
def set_database_url
- ENV['DATABASE_URL'] = File.join("sqlite3://:@localhost", database_url_db_name)
+ ENV['DATABASE_URL'] = "sqlite3:#{database_url_db_name}"
# ensure it's using the DATABASE_URL
FileUtils.rm_rf("#{app_path}/config/database.yml")
end