Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update rack mount #538

Merged
merged 2 commits into from
May 13, 2011
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion actionpack/actionpack.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down
28 changes: 28 additions & 0 deletions railties/test/railties/engine_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down