aboutsummaryrefslogtreecommitdiffstats
path: root/railties/test
diff options
context:
space:
mode:
authorKasper Timm Hansen <kaspth@gmail.com>2016-04-25 08:07:52 +0200
committerKasper Timm Hansen <kaspth@gmail.com>2016-04-25 08:07:52 +0200
commite007afd3cd7255c752fe8ab7fa24b59526ab95cb (patch)
treeef2ce810b2353e608401671d574fe289df61dda0 /railties/test
parentcd9d5c115012e3e8644b359594fdd75459f43dfa (diff)
parent996092ec18ac3ad9e0c573da73325fdc34aefac0 (diff)
downloadrails-e007afd3cd7255c752fe8ab7fa24b59526ab95cb.tar.gz
rails-e007afd3cd7255c752fe8ab7fa24b59526ab95cb.tar.bz2
rails-e007afd3cd7255c752fe8ab7fa24b59526ab95cb.zip
Merge pull request #24696 from y-yagi/remove_unnessary_option_setting
remove unnessary option setting from test runner
Diffstat (limited to 'railties/test')
-rw-r--r--railties/test/application/rake_test.rb11
-rw-r--r--railties/test/application/test_runner_test.rb8
2 files changed, 19 insertions, 0 deletions
diff --git a/railties/test/application/rake_test.rb b/railties/test/application/rake_test.rb
index 69f3b19336..acdb4e7d79 100644
--- a/railties/test/application/rake_test.rb
+++ b/railties/test/application/rake_test.rb
@@ -228,6 +228,17 @@ module ApplicationTests
MESSAGE
end
+ def test_rake_routes_with_rake_options
+ app_file "config/routes.rb", <<-RUBY
+ Rails.application.routes.draw do
+ get '/cart', to: 'cart#show'
+ end
+ RUBY
+
+ output = Dir.chdir(app_path){ `bin/rake --rakefile Rakefile routes` }
+ assert_equal "Prefix Verb URI Pattern Controller#Action\n cart GET /cart(.:format) cart#show\n", output
+ end
+
def test_logger_is_flushed_when_exiting_production_rake_tasks
add_to_config <<-RUBY
rake_tasks do
diff --git a/railties/test/application/test_runner_test.rb b/railties/test/application/test_runner_test.rb
index a1735db5b3..08759ab5a4 100644
--- a/railties/test/application/test_runner_test.rb
+++ b/railties/test/application/test_runner_test.rb
@@ -502,6 +502,14 @@ module ApplicationTests
assert_match '1 runs, 1 assertions', output
end
+ def test_pass_rake_options
+ create_test_file :models, 'account'
+ output = Dir.chdir(app_path) { `bin/rake --rakefile Rakefile --trace=stdout test` }
+
+ assert_match '1 runs, 1 assertions', output
+ assert_match 'Execute test', output
+ end
+
def test_rails_db_create_all_restores_db_connection
create_test_file :models, 'account'
output = Dir.chdir(app_path) { `bin/rails db:create:all db:migrate && echo ".tables" | rails dbconsole` }