Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #394 from splattael/fix_rake_routes_shows_custom_a…

…ssets

Display custom asset routes in `rake routes`
  • Loading branch information...
commit 5e1960ea200274ec2157f5fae1c91ee722b56498 2 parents 008b178 + 97f9000
@josevalim josevalim authored
View
2  railties/lib/rails/tasks/routes.rake
@@ -17,7 +17,7 @@ task :routes => :environment do
end
# Skip the route if it's internal info route
- routes.reject! { |r| r[:path] =~ %r{/rails/info/properties|/assets} }
+ routes.reject! { |r| r[:path] =~ %r{/rails/info/properties|^/assets} }
name_width = routes.map{ |r| r[:name].length }.max
verb_width = routes.map{ |r| r[:verb].length }.max
View
9 railties/test/application/rake_test.rb
@@ -64,6 +64,15 @@ def test_rake_routes_output_strips_anchors_from_http_verbs
assert_match 'cart GET /cart(.:format)', Dir.chdir(app_path){ `rake routes` }
end
+ def test_rake_routes_shows_custom_assets
+ app_file "config/routes.rb", <<-RUBY
+ AppTemplate::Application.routes.draw do
+ get '/custom/assets', :to => 'custom_assets#show'
+ end
+ RUBY
+ assert_match 'custom_assets GET /custom/assets(.:format)', Dir.chdir(app_path){ `rake routes` }
+ end
+
def test_model_and_migration_generator_with_change_syntax
Dir.chdir(app_path) do
`rails generate model user username:string password:string`
Please sign in to comment.
Something went wrong with that request. Please try again.