Permalink
Browse files

Merge pull request #538 from arunagw/update_rack_mount

Update rack mount
  • Loading branch information...
2 parents e2c4282 + e72a6f8 commit 2a98fd96aa2cd33be171bca652098253dbf55f8c @drogus drogus committed May 13, 2011
Showing with 29 additions and 1 deletion.
  1. +1 −1 actionpack/actionpack.gemspec
  2. +28 −0 railties/test/railties/engine_test.rb
@@ -24,7 +24,7 @@ Gem::Specification.new do |s|
s.add_dependency('i18n', '~> 0.6.0beta1')
s.add_dependency('rack', '~> 1.3.0.beta')
s.add_dependency('rack-test', '~> 0.6.0')
- s.add_dependency('rack-mount', '~> 0.7.2')
+ s.add_dependency('rack-mount', '~> 0.7.3')
s.add_dependency('sprockets', '~> 2.0.0.beta.2')
s.add_dependency('tzinfo', '~> 0.3.27')
s.add_dependency('erubis', '~> 2.7.0')
@@ -93,6 +93,34 @@ class Engine < ::Rails::Engine
assert_equal "HELLO WORLD", last_response.body
end
+ test "pass the value of the segment" do
+ controller "foo", <<-RUBY
+ class FooController < ActionController::Base
+ def index
+ render :text => params[:username]
+ end
+ end
+ RUBY
+
+ @plugin.write "config/routes.rb", <<-RUBY
+ Bukkits::Engine.routes.draw do
+ root :to => "foo#index"
+ end
+ RUBY
+
+ app_file "config/routes.rb", <<-RUBY
+ Rails.application.routes.draw do
+ mount(Bukkits::Engine => "/:username")
+ end
+ RUBY
+
+ boot_rails
+
+ get("/arunagw")
+ assert_equal "arunagw", last_response.body
+
+ end
+
test "it provides routes as default endpoint" do
@plugin.write "lib/bukkits.rb", <<-RUBY
class Bukkits

0 comments on commit 2a98fd9

Please sign in to comment.