aboutsummaryrefslogtreecommitdiffstats
path: root/railties/test/application
diff options
context:
space:
mode:
Diffstat (limited to 'railties/test/application')
-rw-r--r--railties/test/application/configuration_test.rb8
-rw-r--r--railties/test/application/rake_test.rb18
2 files changed, 22 insertions, 4 deletions
diff --git a/railties/test/application/configuration_test.rb b/railties/test/application/configuration_test.rb
index c1aa98e481..c813defe93 100644
--- a/railties/test/application/configuration_test.rb
+++ b/railties/test/application/configuration_test.rb
@@ -69,11 +69,11 @@ module ApplicationTests
Rails.env = "development"
assert_equal [:default, "development"], Rails.groups
- assert_equal [:default, "development", :assets], Rails.groups(:assets => [:development])
- assert_equal [:default, "development", :another, :assets], Rails.groups(:another, :assets => %w(development))
+ assert_equal [:default, "development", :assets], Rails.groups(assets: [:development])
+ assert_equal [:default, "development", :another, :assets], Rails.groups(:another, assets: %w(development))
Rails.env = "test"
- assert_equal [:default, "test"], Rails.groups(:assets => [:development])
+ assert_equal [:default, "test"], Rails.groups(assets: [:development])
ENV["RAILS_GROUPS"] = "javascripts,stylesheets"
assert_equal [:default, "test", "javascripts", "stylesheets"], Rails.groups
@@ -567,7 +567,7 @@ module ApplicationTests
app_file 'app/controllers/application_controller.rb', <<-RUBY
class ApplicationController < ActionController::Base
- protect_from_forgery :with => :reset_session # as we are testing API here
+ protect_from_forgery with: :reset_session # as we are testing API here
end
RUBY
diff --git a/railties/test/application/rake_test.rb b/railties/test/application/rake_test.rb
index e0ee349550..6bb50fea19 100644
--- a/railties/test/application/rake_test.rb
+++ b/railties/test/application/rake_test.rb
@@ -144,6 +144,24 @@ module ApplicationTests
assert_no_match(/Errors running/, output)
end
+ def test_db_test_clone_when_using_sql_format
+ add_to_config "config.active_record.schema_format = :sql"
+ output = Dir.chdir(app_path) do
+ `rails generate scaffold user username:string;
+ bundle exec rake db:migrate db:test:clone 2>&1 --trace`
+ end
+ assert_match(/Execute db:test:clone_structure/, output)
+ end
+
+ def test_db_test_prepare_when_using_sql_format
+ add_to_config "config.active_record.schema_format = :sql"
+ output = Dir.chdir(app_path) do
+ `rails generate scaffold user username:string;
+ bundle exec rake db:migrate db:test:clone 2>&1 --trace`
+ end
+ assert_match(/Execute db:test:load_structure/, output)
+ end
+
def test_rake_dump_structure_should_respect_db_structure_env_variable
Dir.chdir(app_path) do
# ensure we have a schema_migrations table to dump