diff options
author | Christiaan Van den Poel <christiaan.vandenpoel@protime.eu> | 2014-05-15 16:08:53 +0200 |
---|---|---|
committer | Christiaan Van den Poel <christiaan.vandenpoel@gmail.com> | 2014-05-15 21:14:46 +0200 |
commit | 20fece149185d7eed03d464b1bbc8a7636bb4f98 (patch) | |
tree | 7263acd880b1353e9396d7ce8af79cb0ff28b3b5 /actionpack/test | |
parent | cf50bbd68c6ceb5a1ac095c5407b79cfc7214788 (diff) | |
download | rails-20fece149185d7eed03d464b1bbc8a7636bb4f98.tar.gz rails-20fece149185d7eed03d464b1bbc8a7636bb4f98.tar.bz2 rails-20fece149185d7eed03d464b1bbc8a7636bb4f98.zip |
fixes stack level too deep exception on action named 'status' returning 'head :ok'
Diffstat (limited to 'actionpack/test')
-rw-r--r-- | actionpack/test/controller/integration_test.rb | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/actionpack/test/controller/integration_test.rb b/actionpack/test/controller/integration_test.rb index 200a2dcc47..214eab2f0d 100644 --- a/actionpack/test/controller/integration_test.rb +++ b/actionpack/test/controller/integration_test.rb @@ -775,3 +775,34 @@ class UrlOptionsIntegrationTest < ActionDispatch::IntegrationTest assert_equal "/foo/1/edit", url_for(:action => 'edit', :only_path => true) end end + +class HeadWithStatusActionIntegrationTest < ActionDispatch::IntegrationTest + class FooController < ActionController::Base + def status + head :ok + end + end + + def self.routes + @routes ||= ActionDispatch::Routing::RouteSet.new + end + + def self.call(env) + routes.call(env) + end + + def app + self.class + end + + routes.draw do + get "/foo/status" => 'head_with_status_action_integration_test/foo#status' + end + + test "get /foo/status with head result does not cause stack overflow error" do + assert_nothing_raised do + get '/foo/status' + end + assert_response :ok + end +end |