mirror of https://github.com/rails/rails
Return "test" as the controller_name in ActionView tests
before https://github.com/rails/rails/pull/40125 test names would be set to "test" after this change controller_name was nil when using ActionView::TestCase. This returns ActionView::TestCase to previous behavior returning "test"
This commit is contained in:
parent
ed3612e6d4
commit
e8156a2788
|
@ -9,7 +9,6 @@ class TestControllerWithExtraEtags < ActionController::Base
|
|||
"test/hello_world.erb" => "Hello world!"
|
||||
)]
|
||||
|
||||
def self.controller_name; "test"; end
|
||||
def self.controller_path; "test"; end
|
||||
|
||||
etag { nil }
|
||||
|
|
|
@ -24,6 +24,10 @@ module ActionView
|
|||
self.class.controller_path = path
|
||||
end
|
||||
|
||||
def self.controller_name
|
||||
"test"
|
||||
end
|
||||
|
||||
def initialize
|
||||
super
|
||||
self.class.controller_path = ""
|
||||
|
|
|
@ -6,7 +6,6 @@ require "active_support/logger"
|
|||
class CaptureController < ActionController::Base
|
||||
self.view_paths = [ File.expand_path("../../fixtures/actionpack", __dir__) ]
|
||||
|
||||
def self.controller_name; "test"; end
|
||||
def self.controller_path; "test"; end
|
||||
|
||||
def content_for
|
||||
|
|
|
@ -56,6 +56,10 @@ module ActionView
|
|||
assert_same _view, view
|
||||
end
|
||||
|
||||
test "returns controller_name" do
|
||||
assert_equal "test", controller_name
|
||||
end
|
||||
|
||||
test "retrieve non existing config values" do
|
||||
assert_nil ActionView::Base.empty.config.something_odd
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue