From 0fae5627a5901a7f4262ade563953dcd55818b86 Mon Sep 17 00:00:00 2001 From: Anton Khorev Date: Tue, 3 Oct 2023 03:06:12 +0300 Subject: [PATCH 1/1] Remove s around --- app/helpers/user_roles_helper.rb | 4 +-- app/views/account/deletions/show.html.erb | 5 +-- app/views/layouts/_flash.html.erb | 15 ++------ app/views/layouts/error.html.erb | 5 +-- test/helpers/user_roles_helper_test.rb | 42 ++--------------------- 5 files changed, 9 insertions(+), 62 deletions(-) diff --git a/app/helpers/user_roles_helper.rb b/app/helpers/user_roles_helper.rb index c9f8e2e65..b870d0273 100644 --- a/app/helpers/user_roles_helper.rb +++ b/app/helpers/user_roles_helper.rb @@ -25,9 +25,7 @@ module UserRolesHelper end if image - svg_icon = tag.source(:srcset => image_path("#{image}.svg"), :type => "image/svg+xml") - png_icon = image_tag("#{image}.png", :srcset => image_path("#{image}.svg"), :size => "20x20", :border => 0, :alt => alt, :title => title) - icon = tag.picture(svg_icon + png_icon) + icon = image_tag("#{image}.png", :srcset => image_path("#{image}.svg"), :size => "20x20", :border => 0, :alt => alt, :title => title) icon = link_to(icon, url, :method => :post, :data => { :confirm => confirm }) if url end diff --git a/app/views/account/deletions/show.html.erb b/app/views/account/deletions/show.html.erb index 99c1686d8..ddc821677 100644 --- a/app/views/account/deletions/show.html.erb +++ b/app/views/account/deletions/show.html.erb @@ -6,10 +6,7 @@
- - " type="image/svg+xml"> - <%= image_tag("notice.png", :srcset => image_path("notice.svg")) %> - + <%= image_tag("notice.png", :srcset => image_path("notice.svg")) %>

<%= t ".warning" %>

diff --git a/app/views/layouts/_flash.html.erb b/app/views/layouts/_flash.html.erb index eaf3078fe..1d3bc3421 100644 --- a/app/views/layouts/_flash.html.erb +++ b/app/views/layouts/_flash.html.erb @@ -1,10 +1,7 @@ <% if flash[:error] %>
- - " type="image/svg+xml" /> - <%= image_tag("notice.png", :srcset => image_path("notice.svg")) %> - + <%= image_tag("notice.png", :srcset => image_path("notice.svg")) %>
<%= render_flash(flash[:error]) %>
@@ -13,10 +10,7 @@ <% if flash[:warning] %>
- - " type="image/svg+xml"> - <%= image_tag("notice.png", :srcset => image_path("notice.svg")) %> - + <%= image_tag("notice.png", :srcset => image_path("notice.svg")) %>
<%= render_flash(flash[:warning]) %>
@@ -25,10 +19,7 @@ <% if flash[:notice] %>
- - " type="image/svg+xml"> - <%= image_tag("notice.png", :srcset => image_path("notice.svg")) %> - + <%= image_tag("notice.png", :srcset => image_path("notice.svg")) %>
<%= render_flash(flash[:notice]) %>
diff --git a/app/views/layouts/error.html.erb b/app/views/layouts/error.html.erb index db6179769..435de3015 100644 --- a/app/views/layouts/error.html.erb +++ b/app/views/layouts/error.html.erb @@ -8,10 +8,7 @@ - - " type="image/svg+xml" /> - <%= image_tag "osm_logo.png", :srcset => image_path("osm_logo.svg"), :alt => t("layouts.logo.alt_text"), :class => "logo" %> - + <%= image_tag "osm_logo.png", :srcset => image_path("osm_logo.svg"), :alt => t("layouts.logo.alt_text"), :class => "logo" %>
<%= yield %> diff --git a/test/helpers/user_roles_helper_test.rb b/test/helpers/user_roles_helper_test.rb index 287504cb4..7708d5115 100644 --- a/test/helpers/user_roles_helper_test.rb +++ b/test/helpers/user_roles_helper_test.rb @@ -11,10 +11,7 @@ class UserRolesHelperTest < ActionView::TestCase icon = role_icon(create(:moderator_user), "moderator") expected = <<~HTML.delete("\n") - - This user is a moderator - HTML assert_dom_equal expected, icon end @@ -26,10 +23,7 @@ class UserRolesHelperTest < ActionView::TestCase icon = role_icon(user, "moderator") expected = <<~HTML.delete("\n") - - Grant moderator access - HTML assert_dom_equal expected, icon @@ -38,10 +32,7 @@ class UserRolesHelperTest < ActionView::TestCase icon = role_icon(moderator_user, "moderator") expected = <<~HTML.delete("\n") - - Revoke moderator access - HTML assert_dom_equal expected, icon @@ -55,23 +46,14 @@ class UserRolesHelperTest < ActionView::TestCase icons = role_icons(create(:moderator_user)) expected = <<~HTML.delete("\n") - - This user is a moderator - HTML assert_dom_equal expected, icons icons = role_icons(create(:super_user)) expected = <<~HTML.delete("\n") - - This user is an administrator - - - This user is a moderator - HTML assert_dom_equal expected, icons end @@ -83,16 +65,10 @@ class UserRolesHelperTest < ActionView::TestCase icons = role_icons(user) expected = <<~HTML.delete("\n") - - Grant administrator access - - - - + Grant moderator access - HTML assert_dom_equal expected, icons @@ -101,16 +77,10 @@ class UserRolesHelperTest < ActionView::TestCase icons = role_icons(moderator_user) expected = <<~HTML.delete("\n") - - Grant administrator access - - - - + Revoke moderator access - HTML assert_dom_equal expected, icons @@ -119,16 +89,10 @@ class UserRolesHelperTest < ActionView::TestCase icons = role_icons(super_user) expected = <<~HTML.delete("\n") - - Revoke administrator access - - - - + Revoke moderator access - HTML assert_dom_equal expected, icons -- 2.39.5