diff options
author | José Valim <jose.valim@gmail.com> | 2010-12-09 13:15:25 +0100 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2010-12-09 13:15:25 +0100 |
commit | 28cf77203b0b5af648e441b5d9cfb75863ba2f39 (patch) | |
tree | 48eadf4df735ec3a201b253d693db054c1386d75 /actionpack/test/dispatch | |
parent | f572a02b94ce85bb8db64e838aa159cf3ef4b1fa (diff) | |
download | rails-28cf77203b0b5af648e441b5d9cfb75863ba2f39.tar.gz rails-28cf77203b0b5af648e441b5d9cfb75863ba2f39.tar.bz2 rails-28cf77203b0b5af648e441b5d9cfb75863ba2f39.zip |
Check if the routes object really responds to define_mount_prefix.
Diffstat (limited to 'actionpack/test/dispatch')
-rw-r--r-- | actionpack/test/dispatch/mount_test.rb | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/actionpack/test/dispatch/mount_test.rb b/actionpack/test/dispatch/mount_test.rb index 0f584af31e..1a032539b9 100644 --- a/actionpack/test/dispatch/mount_test.rb +++ b/actionpack/test/dispatch/mount_test.rb @@ -2,6 +2,17 @@ require 'abstract_unit' class TestRoutingMount < ActionDispatch::IntegrationTest Router = ActionDispatch::Routing::RouteSet.new + + class FakeEngine + def self.routes + Object.new + end + + def self.call(env) + [200, {"Content-Type" => "text/html"}, ["OK"]] + end + end + Router.draw do SprocketsApp = lambda { |env| [200, {"Content-Type" => "text/html"}, ["#{env["SCRIPT_NAME"]} -- #{env["PATH_INFO"]}"]] @@ -10,6 +21,8 @@ class TestRoutingMount < ActionDispatch::IntegrationTest mount SprocketsApp, :at => "/sprockets" mount SprocketsApp => "/shorthand" + mount FakeEngine, :at => "/fakeengine" + scope "/its_a" do mount SprocketsApp, :at => "/sprocket" end @@ -33,4 +46,9 @@ class TestRoutingMount < ActionDispatch::IntegrationTest get "/shorthand/omg" assert_equal "/shorthand -- /omg", response.body end + + def test_with_fake_engine_does_not_call_invalid_method + get "/fakeengine" + assert_equal "OK", response.body + end end
\ No newline at end of file |