From 0a6ac9a76932fb146f49942fe17bdede7fb29ec0 Mon Sep 17 00:00:00 2001 From: Brice Sanchez Date: Wed, 7 Mar 2018 17:09:53 -0500 Subject: [PATCH] Fix refinery_icon_tag and deprecate this helper --- core/app/helpers/refinery/tag_helper.rb | 2 ++ core/spec/helpers/refinery/tag_helper_spec.rb | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/core/app/helpers/refinery/tag_helper.rb b/core/app/helpers/refinery/tag_helper.rb index 5c24239fc2..bb2bca1ede 100644 --- a/core/app/helpers/refinery/tag_helper.rb +++ b/core/app/helpers/refinery/tag_helper.rb @@ -12,6 +12,8 @@ def refinery_help_tag(title='Tip') # This is just a quick wrapper to render an image tag that lives inside refinery/icons. # They are all 16x16 so this is the default but is able to be overriden with supplied options. def refinery_icon_tag(filename, options = {}) + Refinery.deprecate('Refinery::TagHelper.refinery_icon_tag', when: '4.1', replacement: 'Refinery::TagHelper.action_icon') + filename = "#{filename}.png" unless filename.split('.').many? path = image_path "refinery/icons/#{filename}", skip_pipeline: true image_tag path, {:width => 16, :height => 16}.merge(options) diff --git a/core/spec/helpers/refinery/tag_helper_spec.rb b/core/spec/helpers/refinery/tag_helper_spec.rb index a833de8634..de7cd1b864 100644 --- a/core/spec/helpers/refinery/tag_helper_spec.rb +++ b/core/spec/helpers/refinery/tag_helper_spec.rb @@ -15,7 +15,7 @@ module Refinery end it "wraps image_tag with some options preset" do - expect(helper.refinery_icon_tag("ugis.ozols.jpg")).to xml_eq(%Q{Ugis.ozols}) + expect(helper.refinery_icon_tag("ugis.ozols.jpg", { alt: "Ugis.ozols"})).to xml_eq(%Q{Ugis.ozols}) end end