Merge pull request #538 from arunagw/update_rack_mount

Update rack mount
This commit is contained in:
Piotr Sarnacki
2011-05-13 02:55:22 -07:00
2 changed files with 29 additions and 1 deletions

View File

@@ -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')

View File

@@ -93,6 +93,34 @@ module RailtiesTest
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