Display custom asset routes in rake routes

This commit is contained in:
Peter Suschlik
2011-05-05 12:05:25 +02:00
parent 3e9bb5459c
commit 97f9000cf2
2 changed files with 10 additions and 1 deletions

View File

@@ -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 File

@@ -64,6 +64,15 @@ module ApplicationTests
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`