Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge branch 'master' of github.com:rails/rails

  • Loading branch information...
commit fee07b9da0bddbb1833da947ed73e7a165d040e7 2 parents cf66d16 + 880688a
@dhh dhh authored
View
6 actionpack/lib/action_controller/metal/rack_delegation.rb
@@ -3,7 +3,7 @@ module RackDelegation
extend ActiveSupport::Concern
included do
- delegate :session, :reset_session, :to => "@_request"
+ delegate :session, :to => "@_request"
delegate :headers, :status=, :location=, :content_type=,
:status, :location, :content_type, :to => "@_response"
attr_internal :request
@@ -24,5 +24,9 @@ def response_body=(body)
response.body = body if response
super
end
+
+ def reset_session
+ @_request.reset_session
+ end
end
end
View
4 actionpack/lib/action_dispatch/routing/route_set.rb
@@ -5,7 +5,7 @@ module ActionDispatch
module Routing
class RouteSet #:nodoc:
NotFound = lambda { |env|
- raise ActionController::RoutingError, "No route matches #{env['PATH_INFO'].inspect} with #{env.inspect}"
+ raise ActionController::RoutingError, "No route matches #{env['PATH_INFO'].inspect}"
}
PARAMETERS_KEY = 'action_dispatch.request.path_parameters'
@@ -426,7 +426,7 @@ def recognize_path(path, environment = {})
end
end
- raise ActionController::RoutingError, "No route matches #{path.inspect} with #{environment.inspect}"
+ raise ActionController::RoutingError, "No route matches #{path.inspect}"
end
end
end
View
24 actionpack/test/controller/flash_test.rb
@@ -34,7 +34,7 @@ def use_flash_and_keep_it
flash.keep
render :inline => "hello"
end
-
+
def use_flash_and_update_it
flash.update("this" => "hello again")
@flash_copy = {}.update flash
@@ -76,11 +76,11 @@ def halt_and_redir
def redirect_with_alert
redirect_to '/nowhere', :alert => "Beware the nowheres!"
end
-
+
def redirect_with_notice
redirect_to '/somewhere', :notice => "Good luck in the somewheres!"
end
-
+
def redirect_with_other_flashes
redirect_to '/wonderland', :flash => { :joyride => "Horses!" }
end
@@ -101,7 +101,7 @@ def test_flash
def test_keep_flash
get :set_flash
-
+
get :use_flash_and_keep_it
assert_equal "hello", assigns["flash_copy"]["that"]
assert_equal "hello", assigns["flashy"]
@@ -112,7 +112,7 @@ def test_keep_flash
get :use_flash
assert_nil assigns["flash_copy"]["that"], "On third flash"
end
-
+
def test_flash_now
get :set_flash_now
assert_equal "hello", assigns["flash_copy"]["that"]
@@ -123,8 +123,8 @@ def test_flash_now
assert_nil assigns["flash_copy"]["that"]
assert_nil assigns["flash_copy"]["foo"]
assert_nil assigns["flashy"]
- end
-
+ end
+
def test_update_flash
get :set_flash
get :use_flash_and_update_it
@@ -140,7 +140,7 @@ def test_flash_after_reset_session
assert_equal "hello", assigns["flashy_that"]
assert_equal "good-bye", assigns["flashy_this"]
assert_nil assigns["flashy_that_reset"]
- end
+ end
def test_does_not_set_the_session_if_the_flash_is_empty
get :std_action
@@ -165,24 +165,24 @@ def test_keep_and_discard_return_values
assert_equal(:foo_indeed, flash.discard(:foo)) # valid key passed
assert_nil flash.discard(:unknown) # non existant key passed
assert_equal({:foo => :foo_indeed, :bar => :bar_indeed}, flash.discard()) # nothing passed
- assert_equal({:foo => :foo_indeed, :bar => :bar_indeed}, flash.discard(nil)) # nothing passed
+ assert_equal({:foo => :foo_indeed, :bar => :bar_indeed}, flash.discard(nil)) # nothing passed
assert_equal(:foo_indeed, flash.keep(:foo)) # valid key passed
assert_nil flash.keep(:unknown) # non existant key passed
assert_equal({:foo => :foo_indeed, :bar => :bar_indeed}, flash.keep()) # nothing passed
- assert_equal({:foo => :foo_indeed, :bar => :bar_indeed}, flash.keep(nil)) # nothing passed
+ assert_equal({:foo => :foo_indeed, :bar => :bar_indeed}, flash.keep(nil)) # nothing passed
end
def test_redirect_to_with_alert
get :redirect_with_alert
assert_equal "Beware the nowheres!", @controller.send(:flash)[:alert]
end
-
+
def test_redirect_to_with_notice
get :redirect_with_notice
assert_equal "Good luck in the somewheres!", @controller.send(:flash)[:notice]
end
-
+
def test_redirect_to_with_other_flashes
get :redirect_with_other_flashes
assert_equal "Horses!", @controller.send(:flash)[:joyride]
View
2  ci/geminstaller.yml
@@ -5,4 +5,4 @@ gems:
- name: rubygems-update
version: >= 1.3.5
- name: bundler
- version: >= 0.6.0
+ version: >= 0.7.1
View
18 railties/test/application/routing_test.rb
@@ -28,6 +28,12 @@ def index
end
RUBY
+ app_file 'config/routes.rb', <<-RUBY
+ ActionController::Routing::Routes.draw do |map|
+ match ':controller(/:action)'
+ end
+ RUBY
+
get '/foo'
assert_equal 'foo', last_response.body
end
@@ -49,6 +55,12 @@ def index
end
RUBY
+ app_file 'config/routes.rb', <<-RUBY
+ ActionController::Routing::Routes.draw do |map|
+ match ':controller(/:action)'
+ end
+ RUBY
+
get '/foo'
assert_equal 'foo', last_response.body
@@ -75,6 +87,12 @@ def index
end
RUBY
+ app_file 'config/routes.rb', <<-RUBY
+ ActionController::Routing::Routes.draw do |map|
+ match ':controller(/:action)'
+ end
+ RUBY
+
get '/foo'
assert_equal 'foo', last_response.body
Please sign in to comment.
Something went wrong with that request. Please try again.