aboutsummaryrefslogtreecommitdiffstats
path: root/actionview/test/actionpack/controller/layout_test.rb
diff options
context:
space:
mode:
authorMatthew Draper <matthew@trebex.net>2017-05-26 12:24:43 +0930
committerGitHub <noreply@github.com>2017-05-26 12:24:43 +0930
commit4cfcf1ee542706c92c6c9b2e973e81b673fb220f (patch)
tree3bd9ec449ab553c73f34ec018f5450938b6831c7 /actionview/test/actionpack/controller/layout_test.rb
parent881823176a3fcaa3711900f2cdfd66b11a6df18a (diff)
parent40bdbce191ad90dfea43dad51fac5c4726b89392 (diff)
downloadrails-4cfcf1ee542706c92c6c9b2e973e81b673fb220f.tar.gz
rails-4cfcf1ee542706c92c6c9b2e973e81b673fb220f.tar.bz2
rails-4cfcf1ee542706c92c6c9b2e973e81b673fb220f.zip
Merge pull request #29176 from bogdanvlviv/define-path-with__dir__
Define path with __dir__
Diffstat (limited to 'actionview/test/actionpack/controller/layout_test.rb')
-rw-r--r--actionview/test/actionpack/controller/layout_test.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/actionview/test/actionpack/controller/layout_test.rb b/actionview/test/actionpack/controller/layout_test.rb
index b79835ff34..b3e0329f57 100644
--- a/actionview/test/actionpack/controller/layout_test.rb
+++ b/actionview/test/actionpack/controller/layout_test.rb
@@ -5,7 +5,7 @@ require "active_support/core_ext/array/extract_options"
# method has access to the view_paths array when looking for a layout to automatically assign.
old_load_paths = ActionController::Base.view_paths
-ActionController::Base.view_paths = [ File.dirname(__FILE__) + "/../../fixtures/actionpack/layout_tests/" ]
+ActionController::Base.view_paths = [ File.expand_path("../../fixtures/actionpack/layout_tests", __dir__) ]
class LayoutTest < ActionController::Base
def self.controller_path; "views" end
@@ -96,7 +96,7 @@ class StreamingLayoutController < LayoutTest
end
class AbsolutePathLayoutController < LayoutTest
- layout File.expand_path(File.expand_path(__FILE__) + "/../../../fixtures/actionpack/layout_tests/layouts/layout_test")
+ layout File.expand_path("../../fixtures/actionpack/layout_tests/layouts/layout_test", __dir__)
end
class HasOwnLayoutController < LayoutTest
@@ -117,7 +117,7 @@ end
class PrependsViewPathController < LayoutTest
def hello
- prepend_view_path File.dirname(__FILE__) + "/../../fixtures/actionpack/layout_tests/alt/"
+ prepend_view_path File.expand_path("../../fixtures/actionpack/layout_tests/alt", __dir__)
render layout: "alt"
end
end