diff options
Diffstat (limited to 'actionpack/test/controller/new_base/base_test.rb')
-rw-r--r-- | actionpack/test/controller/new_base/base_test.rb | 33 |
1 files changed, 16 insertions, 17 deletions
diff --git a/actionpack/test/controller/new_base/base_test.rb b/actionpack/test/controller/new_base/base_test.rb index 0755dafe93..280134f8d2 100644 --- a/actionpack/test/controller/new_base/base_test.rb +++ b/actionpack/test/controller/new_base/base_test.rb @@ -1,4 +1,6 @@ -require 'abstract_unit' +# frozen_string_literal: true + +require "abstract_unit" # Tests the controller dispatching happy path module Dispatching @@ -25,7 +27,7 @@ module Dispatching render body: "actions: #{action_methods.to_a.sort.join(', ')}" end - protected + private def authenticate end end @@ -45,7 +47,6 @@ module Dispatching end class BaseTest < Rack::TestCase - # :api: plugin test "simple dispatching" do get "/dispatching/simple/index" @@ -54,14 +55,12 @@ module Dispatching assert_content_type "text/plain; charset=utf-8" end - # :api: plugin test "directly modifying response body" do get "/dispatching/simple/modify_response_body" assert_body "success" end - # :api: plugin test "directly modifying response body twice" do get "/dispatching/simple/modify_response_body_twice" @@ -69,48 +68,48 @@ module Dispatching end test "controller path" do - assert_equal 'dispatching/empty', EmptyController.controller_path + assert_equal "dispatching/empty", EmptyController.controller_path assert_equal EmptyController.controller_path, EmptyController.new.controller_path end test "non-default controller path" do - assert_equal 'i_am_not_default', NonDefaultPathController.controller_path + assert_equal "i_am_not_default", NonDefaultPathController.controller_path assert_equal NonDefaultPathController.controller_path, NonDefaultPathController.new.controller_path end test "sub controller path" do - assert_equal 'dispatching/sub_empty', SubEmptyController.controller_path + assert_equal "dispatching/sub_empty", SubEmptyController.controller_path assert_equal SubEmptyController.controller_path, SubEmptyController.new.controller_path end test "namespaced controller path" do - assert_equal 'dispatching/submodule/contained_empty', Submodule::ContainedEmptyController.controller_path + assert_equal "dispatching/submodule/contained_empty", Submodule::ContainedEmptyController.controller_path assert_equal Submodule::ContainedEmptyController.controller_path, Submodule::ContainedEmptyController.new.controller_path end test "namespaced non-default controller path" do - assert_equal 'i_am_extremely_not_default', Submodule::ContainedNonDefaultPathController.controller_path + assert_equal "i_am_extremely_not_default", Submodule::ContainedNonDefaultPathController.controller_path assert_equal Submodule::ContainedNonDefaultPathController.controller_path, Submodule::ContainedNonDefaultPathController.new.controller_path end test "namespaced sub controller path" do - assert_equal 'dispatching/submodule/contained_sub_empty', Submodule::ContainedSubEmptyController.controller_path + assert_equal "dispatching/submodule/contained_sub_empty", Submodule::ContainedSubEmptyController.controller_path assert_equal Submodule::ContainedSubEmptyController.controller_path, Submodule::ContainedSubEmptyController.new.controller_path end test "controller name" do - assert_equal 'empty', EmptyController.controller_name - assert_equal 'contained_empty', Submodule::ContainedEmptyController.controller_name + assert_equal "empty", EmptyController.controller_name + assert_equal "contained_empty", Submodule::ContainedEmptyController.controller_name end test "non-default path controller name" do - assert_equal 'non_default_path', NonDefaultPathController.controller_name - assert_equal 'contained_non_default_path', Submodule::ContainedNonDefaultPathController.controller_name + assert_equal "non_default_path", NonDefaultPathController.controller_name + assert_equal "contained_non_default_path", Submodule::ContainedNonDefaultPathController.controller_name end test "sub controller name" do - assert_equal 'sub_empty', SubEmptyController.controller_name - assert_equal 'contained_sub_empty', Submodule::ContainedSubEmptyController.controller_name + assert_equal "sub_empty", SubEmptyController.controller_name + assert_equal "contained_sub_empty", Submodule::ContainedSubEmptyController.controller_name end test "action methods" do |