+ create(:moderator_user) do |user|
+ icon = role_icon(user, "moderator")
+ icon_dom = Rails::Dom::Testing.html_document_fragment.parse(icon)
+ assert_dom icon_dom, "a:root[href='#{user_role_path(user, 'moderator')}'][data-method='delete']", :count => 1 do
+ assert_dom "> svg", :count => 1 do
+ assert_dom "> title", :text => "Revoke moderator access"
+ end
+ end
+
+ icon = role_icon(user, "importer")
+ icon_dom = Rails::Dom::Testing.html_document_fragment.parse(icon)
+ assert_dom icon_dom, "a:root[href='#{user_role_path(user, 'importer')}'][data-method='post']", :count => 1 do
+ assert_dom "> svg", :count => 1 do
+ assert_dom "> title", :text => "Grant importer access"
+ end
+ end
+ end
+
+ create(:importer_user) do |user|
+ icon = role_icon(user, "moderator")
+ icon_dom = Rails::Dom::Testing.html_document_fragment.parse(icon)
+ assert_dom icon_dom, "a:root[href='#{user_role_path(user, 'moderator')}'][data-method='post']", :count => 1 do
+ assert_dom "> svg", :count => 1 do
+ assert_dom "> title", :text => "Grant moderator access"
+ end
+ end
+
+ icon = role_icon(user, "importer")
+ icon_dom = Rails::Dom::Testing.html_document_fragment.parse(icon)
+ assert_dom icon_dom, "a:root[href='#{user_role_path(user, 'importer')}'][data-method='delete']", :count => 1 do
+ assert_dom "> svg", :count => 1 do
+ assert_dom "> title", :text => "Revoke importer access"
+ end
+ end
+ end