aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/controller/new_base/bare_metal_test.rb
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/test/controller/new_base/bare_metal_test.rb')
-rw-r--r--actionpack/test/controller/new_base/bare_metal_test.rb22
1 files changed, 22 insertions, 0 deletions
diff --git a/actionpack/test/controller/new_base/bare_metal_test.rb b/actionpack/test/controller/new_base/bare_metal_test.rb
index 8a06e8d2a0..3ca29f1bcf 100644
--- a/actionpack/test/controller/new_base/bare_metal_test.rb
+++ b/actionpack/test/controller/new_base/bare_metal_test.rb
@@ -24,4 +24,26 @@ module BareMetalTest
assert_equal "Hello world", string
end
end
+
+ class HeadController < ActionController::Metal
+ include ActionController::Head
+
+ def index
+ head :not_found
+ end
+ end
+
+ class HeadTest < ActiveSupport::TestCase
+ test "head works on its own" do
+ status = HeadController.action(:index).call(Rack::MockRequest.env_for("/")).first
+ assert_equal 404, status
+ end
+ end
+
+ class BareControllerTest < ActionController::TestCase
+ test "GET index" do
+ get :index
+ assert_equal "Hello world", @response.body
+ end
+ end
end