Browse files

Adding a test to make sure that using rake routes with the CONTROLLER

environment works correctly.
  • Loading branch information...
1 parent c2f3eff commit 42c9bd06174b18124a907d0c2a7b3e4bb584cfd0 @wangjohn wangjohn committed May 29, 2013
Showing with 12 additions and 0 deletions.
  1. +12 −0 railties/test/application/rake_test.rb
View
12 railties/test/application/rake_test.rb
@@ -151,6 +151,18 @@ def test_rake_routes_calls_the_route_inspector
assert_equal "Prefix Verb URI Pattern Controller#Action\ncart GET /cart(.:format) cart#show\n", output
end
+ def test_rake_routes_with_controller_environment
+ app_file "config/routes.rb", <<-RUBY
+ AppTemplate::Application.routes.draw do
+ get '/cart', to: 'cart#show'
+ get '/basketball', to: 'basketball#index'
+ end
+ RUBY
+
+ output = Dir.chdir(app_path){ `CONTROLLER=cart rake routes` }
+ assert_equal "Prefix Verb URI Pattern Controller#Action\ncart GET /cart(.:format) cart#show\n", output
+ end
+
def test_rake_routes_displays_message_when_no_routes_are_defined
app_file "config/routes.rb", <<-RUBY
AppTemplate::Application.routes.draw do

0 comments on commit 42c9bd0

Please sign in to comment.