aboutsummaryrefslogtreecommitdiffstats
path: root/actionview/test/template
diff options
context:
space:
mode:
Diffstat (limited to 'actionview/test/template')
-rw-r--r--actionview/test/template/compiled_templates_test.rb40
-rw-r--r--actionview/test/template/form_helper_test.rb1
-rw-r--r--actionview/test/template/form_options_helper_test.rb1
-rw-r--r--actionview/test/template/form_tag_helper_test.rb1
4 files changed, 1 insertions, 42 deletions
diff --git a/actionview/test/template/compiled_templates_test.rb b/actionview/test/template/compiled_templates_test.rb
index d7f2e8ee07..59fa058bed 100644
--- a/actionview/test/template/compiled_templates_test.rb
+++ b/actionview/test/template/compiled_templates_test.rb
@@ -60,46 +60,8 @@ class CompiledTemplatesTest < ActiveSupport::TestCase
assert_equal "two", render(template: "test/render_file_with_locals_and_default", locals: { secret: "two" })
end
- def test_template_changes_are_not_reflected_with_cached_templates
- assert_equal "Hello world!", render(template: "test/hello_world")
- modify_template "test/hello_world.erb", "Goodbye world!" do
- assert_equal "Hello world!", render(template: "test/hello_world")
- end
- assert_equal "Hello world!", render(template: "test/hello_world")
- end
-
- def test_template_changes_are_reflected_with_uncached_templates
- assert_equal "Hello world!", render_without_cache(template: "test/hello_world")
- modify_template "test/hello_world.erb", "Goodbye world!" do
- assert_equal "Goodbye world!", render_without_cache(template: "test/hello_world")
- end
- assert_equal "Hello world!", render_without_cache(template: "test/hello_world")
- end
-
private
def render(*args)
- render_with_cache(*args)
- end
-
- def render_with_cache(*args)
- view_paths = ActionController::Base.view_paths
- view_class.with_view_paths(view_paths, {}).render(*args)
- end
-
- def render_without_cache(*args)
- path = ActionView::FileSystemResolver.new(FIXTURE_LOAD_PATH)
- view_paths = ActionView::PathSet.new([path])
- view_class.with_view_paths(view_paths, {}).render(*args)
- end
-
- def modify_template(template, content)
- filename = "#{FIXTURE_LOAD_PATH}/#{template}"
- old_content = File.read(filename)
- begin
- File.open(filename, "wb+") { |f| f.write(content) }
- yield
- ensure
- File.open(filename, "wb+") { |f| f.write(old_content) }
- end
+ ActionController::Base.render(*args)
end
end
diff --git a/actionview/test/template/form_helper_test.rb b/actionview/test/template/form_helper_test.rb
index 91052e5ae2..83b089397c 100644
--- a/actionview/test/template/form_helper_test.rb
+++ b/actionview/test/template/form_helper_test.rb
@@ -1897,7 +1897,6 @@ class FormHelperTest < ActionView::TestCase
def test_form_tags_do_not_call_private_properties_on_form_object
obj = Class.new do
private
-
def private_property
raise "This method should not be called."
end
diff --git a/actionview/test/template/form_options_helper_test.rb b/actionview/test/template/form_options_helper_test.rb
index c9c36917d6..d7a7b95ab3 100644
--- a/actionview/test/template/form_options_helper_test.rb
+++ b/actionview/test/template/form_options_helper_test.rb
@@ -1472,7 +1472,6 @@ class FormOptionsHelperTest < ActionView::TestCase
end
private
-
def dummy_posts
[ Post.new("<Abe> went home", "<Abe>", "To a little house", "shh!"),
Post.new("Babe went home", "Babe", "To a little house", "shh!"),
diff --git a/actionview/test/template/form_tag_helper_test.rb b/actionview/test/template/form_tag_helper_test.rb
index 70c5ae6771..80afed96e5 100644
--- a/actionview/test/template/form_tag_helper_test.rb
+++ b/actionview/test/template/form_tag_helper_test.rb
@@ -803,7 +803,6 @@ class FormTagHelperTest < ActionView::TestCase
end
private
-
def root_elem(rendered_content)
Nokogiri::HTML::DocumentFragment.parse(rendered_content).children.first # extract from nodeset
end