+ 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='#{grant_role_path(user, 'administrator')}']" do
+ assert_dom "> svg > title", :text => "Grant administrator access"
+ end
+ assert_dom icons_dom, "a:root[href='#{grant_role_path(user, 'moderator')}']" do
+ assert_dom "> svg > title", :text => "Grant moderator access"
+ end
+ assert_dom icons_dom, "a:root[href='#{grant_role_path(user, 'importer')}']" 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='#{grant_role_path(user, 'administrator')}']" do
+ assert_dom "> svg > title", :text => "Grant administrator access"
+ end
+ assert_dom icons_dom, "a:root[href='#{revoke_role_path(user, 'moderator')}']" do
+ assert_dom "> svg > title", :text => "Revoke moderator access"
+ end
+ assert_dom icons_dom, "a:root[href='#{grant_role_path(user, 'importer')}']" do
+ assert_dom "> svg > title", :text => "Grant importer access"
+ end
+ end