aboutsummaryrefslogtreecommitdiffstats
path: root/actionview/test
diff options
context:
space:
mode:
authorJohn Hawthorn <john@hawthorn.email>2019-04-04 12:42:57 -0700
committerJohn Hawthorn <john@hawthorn.email>2019-04-04 14:25:31 -0700
commitb8c90c36444b9c239935b470cb04adddf09e2c60 (patch)
tree924343ab24d0f8793666544012179ef31dc7c2b6 /actionview/test
parenta8aca0235092c33527aedea6ce8bf82766f8cec1 (diff)
downloadrails-b8c90c36444b9c239935b470cb04adddf09e2c60.tar.gz
rails-b8c90c36444b9c239935b470cb04adddf09e2c60.tar.bz2
rails-b8c90c36444b9c239935b470cb04adddf09e2c60.zip
Don't discard source after rendering
Previously, we would discard the template source after rendering, if we had a virtual path, in hopes that the virtual path would let us find our same template again going through the Resolver. Previously we discarded the source as an optimization, to avoid keeping it around in memory. By instead just reading the file every time source is called, as FileTemplate does, this is unnecessary.
Diffstat (limited to 'actionview/test')
-rw-r--r--actionview/test/template/template_test.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/actionview/test/template/template_test.rb b/actionview/test/template/template_test.rb
index 71fb99115b..5ccddb3e9e 100644
--- a/actionview/test/template/template_test.rb
+++ b/actionview/test/template/template_test.rb
@@ -91,10 +91,10 @@ class TestERBTemplate < ActiveSupport::TestCase
assert_equal "<%= hello %>", render
end
- def test_template_loses_its_source_after_rendering
+ def test_template_does_not_lose_its_source_after_rendering
@template = new_template
render
- assert_nil @template.source
+ assert_equal "<%= hello %>", @template.source
end
def test_template_does_not_lose_its_source_after_rendering_if_it_does_not_have_a_virtual_path