diff options
author | Giorgos Vrettos <gcv@digeratigroup.com> | 2017-03-02 11:54:58 +0200 |
---|---|---|
committer | Giorgos Vrettos <gcv@digeratigroup.com> | 2017-03-06 13:12:14 +0200 |
commit | 32046deced9ab891c59a5474419b69824b3c8803 (patch) | |
tree | d8742e05331d0d0ce8ecab310a667a898d6ea685 /actionpack/test | |
parent | 0b5c7e354291bdf674fa8777b6443b224924bad4 (diff) | |
download | rails-32046deced9ab891c59a5474419b69824b3c8803.tar.gz rails-32046deced9ab891c59a5474419b69824b3c8803.tar.bz2 rails-32046deced9ab891c59a5474419b69824b3c8803.zip |
Fix malformed asset_url when rendering template with ActionController::Renderer
Diffstat (limited to 'actionpack/test')
-rw-r--r-- | actionpack/test/controller/renderer_test.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/actionpack/test/controller/renderer_test.rb b/actionpack/test/controller/renderer_test.rb index 866600b935..81b32a67b3 100644 --- a/actionpack/test/controller/renderer_test.rb +++ b/actionpack/test/controller/renderer_test.rb @@ -103,6 +103,20 @@ class RendererTest < ActiveSupport::TestCase assert_equal "true", content end + test "return valid asset url with defaults" do + renderer = ApplicationController.renderer + content = renderer.render inline: "<%= asset_url 'asset.jpg' %>" + + assert_equal "http://example.org/asset.jpg", content + end + + test "return valid asset url when https is true" do + renderer = ApplicationController.renderer.new https: true + content = renderer.render inline: "<%= asset_url 'asset.jpg' %>" + + assert_equal "https://example.org/asset.jpg", content + end + private def render @render ||= ApplicationController.renderer.method(:render) |