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