Skip to content

Commit

Permalink
Fix refinery_icon_tag and deprecate this helper
Browse files Browse the repository at this point in the history
  • Loading branch information
bricesanchez committed Mar 8, 2018
1 parent 70cd41c commit ee0b74b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions core/app/helpers/refinery/tag_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion core/spec/helpers/refinery/tag_helper_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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{<img alt="Ugis.ozols" height="16" src="/images/refinery/icons/ugis.ozols.jpg" width="16" />})
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" />})
end
end

Expand Down

0 comments on commit ee0b74b

Please sign in to comment.