aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2014-05-15 16:18:05 -0300
committerRafael Mendonça França <rafaelmfranca@gmail.com>2014-05-15 16:18:37 -0300
commit16a8a68b7eb71e57fc457750758d2dc8e978584b (patch)
tree11a3b749a0889e3d2a38e919d70a1143c119fe77 /actionpack/test
parentcf50bbd68c6ceb5a1ac095c5407b79cfc7214788 (diff)
parent20fece149185d7eed03d464b1bbc8a7636bb4f98 (diff)
downloadrails-16a8a68b7eb71e57fc457750758d2dc8e978584b.tar.gz
rails-16a8a68b7eb71e57fc457750758d2dc8e978584b.tar.bz2
rails-16a8a68b7eb71e57fc457750758d2dc8e978584b.zip
Merge pull request #15118 from khelben/head_with_status_action_stack_level_too_deep
fixes stack level too deep exception on action named 'status' rendering 'head :ok'
Diffstat (limited to 'actionpack/test')
-rw-r--r--actionpack/test/controller/integration_test.rb31
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