Skip to content

Commit ee0b74b

Browse files
committed
Fix refinery_icon_tag and deprecate this helper
1 parent 70cd41c commit ee0b74b

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

core/app/helpers/refinery/tag_helper.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ def refinery_help_tag(title='Tip')
1212
# This is just a quick wrapper to render an image tag that lives inside refinery/icons.
1313
# They are all 16x16 so this is the default but is able to be overriden with supplied options.
1414
def refinery_icon_tag(filename, options = {})
15+
Refinery.deprecate('Refinery::TagHelper.refinery_icon_tag', when: '4.1', replacement: 'Refinery::TagHelper.action_icon')
16+
1517
filename = "#{filename}.png" unless filename.split('.').many?
1618
path = image_path "refinery/icons/#{filename}", skip_pipeline: true
1719
image_tag path, {:width => 16, :height => 16}.merge(options)

core/spec/helpers/refinery/tag_helper_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ module Refinery
1515
end
1616

1717
it "wraps image_tag with some options preset" do
18-
expect(helper.refinery_icon_tag("ugis.ozols.jpg")).to xml_eq(%Q{<img alt="Ugis.ozols" height="16" src="/images/refinery/icons/ugis.ozols.jpg" width="16" />})
18+
expect(helper.refinery_icon_tag("ugis.ozols.jpg", { alt: "Ugis.ozols"})).to xml_eq(%Q{<img alt="Ugis.ozols" height="16" src="/images/refinery/icons/ugis.ozols.jpg" width="16" />})
1919
end
2020
end
2121

0 commit comments

Comments
 (0)