aboutsummaryrefslogtreecommitdiffstats
path: root/railties/test/application
diff options
context:
space:
mode:
authorPrem Sichanugrist <s@sikac.hu>2013-02-25 17:04:01 -0500
committerPrem Sichanugrist <s@sikac.hu>2013-03-09 17:38:39 -0500
commitb51673fbd9563bd3ffa22e22255ca1cef80cfb6d (patch)
tree8af67d62b1414e088750394f6970478d4dbf90e5 /railties/test/application
parentdf85dfa6fa6f7ae9a0b72eb9b9a254d2d5560f38 (diff)
downloadrails-b51673fbd9563bd3ffa22e22255ca1cef80cfb6d.tar.gz
rails-b51673fbd9563bd3ffa22e22255ca1cef80cfb6d.tar.bz2
rails-b51673fbd9563bd3ffa22e22255ca1cef80cfb6d.zip
Update Rake tasks to call `rails test` instead
Also, print out deprecation warning for other rake tasks except `rake test` and `rake` (default)
Diffstat (limited to 'railties/test/application')
-rw-r--r--railties/test/application/rake_test.rb23
1 files changed, 13 insertions, 10 deletions
diff --git a/railties/test/application/rake_test.rb b/railties/test/application/rake_test.rb
index 09f2ad1209..a9e0e1bcb7 100644
--- a/railties/test/application/rake_test.rb
+++ b/railties/test/application/rake_test.rb
@@ -91,19 +91,9 @@ module ApplicationTests
raise 'models'
RUBY
- app_file "test/controllers/one_controller_test.rb", <<-RUBY
- raise 'controllers'
- RUBY
-
- app_file "test/integration/one_integration_test.rb", <<-RUBY
- raise 'integration'
- RUBY
-
silence_stderr do
output = Dir.chdir(app_path) { `rake test 2>&1` }
assert_match 'models', output
- assert_match 'controllers', output
- assert_match 'integration', output
end
end
@@ -135,6 +125,19 @@ module ApplicationTests
end
end
+ def test_rake_test_deprecation_messages
+ Dir.chdir(app_path){ `rails generate scaffold user name:string` }
+ Dir.chdir(app_path){ `rake db:migrate` }
+
+ %w(run recent uncommitted models helpers units controllers functionals integration).each do |test_suit_name|
+ output = Dir.chdir(app_path) { `rake test:#{test_suit_name} 2>&1` }
+ assert_match /DEPRECATION WARNING: `rake test:#{test_suit_name}` is deprecated/, output
+ end
+
+ assert_match /DEPRECATION WARNING: `rake test:single` is deprecated/,
+ Dir.chdir(app_path) { `rake test:single TEST=test/models/user_test.rb 2>&1` }
+ end
+
def test_rake_routes_calls_the_route_inspector
app_file "config/routes.rb", <<-RUBY
AppTemplate::Application.routes.draw do