diff options
author | Hendy Tanata <htanata@gmail.com> | 2011-07-17 00:16:40 +0800 |
---|---|---|
committer | Hendy Tanata <htanata@gmail.com> | 2011-07-17 00:49:48 +0800 |
commit | 7b619f1d7b3d261918592d4a9144d4a5d335d4b0 (patch) | |
tree | 0c62069b5706a73bbcf2ce5442bc67fcf3227529 /railties/test | |
parent | 193e4de20646a025bf6dd3f90d1f9a53edb1cecf (diff) | |
download | rails-7b619f1d7b3d261918592d4a9144d4a5d335d4b0.tar.gz rails-7b619f1d7b3d261918592d4a9144d4a5d335d4b0.tar.bz2 rails-7b619f1d7b3d261918592d4a9144d4a5d335d4b0.zip |
Improve formatting of route to Rack application in rake routes.
This route:
match 'foo/:id' => RackApp, :id => /[A-Z]\d{5}/
is shown as:
/foo/:id(.:format) RackApp {:id=>/[A-Z]\d{5}/}
Diffstat (limited to 'railties/test')
-rw-r--r-- | railties/test/application/rake_test.rb | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/railties/test/application/rake_test.rb b/railties/test/application/rake_test.rb index 6988b2541d..cc65a674c9 100644 --- a/railties/test/application/rake_test.rb +++ b/railties/test/application/rake_test.rb @@ -166,6 +166,27 @@ module ApplicationTests assert_equal " /photos/:id(.:format) photos#show {:id=>/[A-Z]\\d{5}/}\n", Dir.chdir(app_path){ `rake routes` } end + def test_rake_routes_shows_route_with_rack_app + app_file "lib/rack_app.rb", <<-RUBY + class RackApp + class << self + def call(env) + end + end + end + RUBY + + app_file "config/routes.rb", <<-RUBY + require 'rack_app' + + AppTemplate::Application.routes.draw do + match 'foo/:id' => RackApp, :id => /[A-Z]\\d{5}/ + end + RUBY + + assert_equal " /foo/:id(.:format) RackApp {:id=>/[A-Z]\\d{5}/}\n", Dir.chdir(app_path){ `rake routes` } + end + def test_logger_is_flushed_when_exiting_production_rake_tasks add_to_config <<-RUBY rake_tasks do |