Contents

Admin manage skins

@set-default-skin

Scenario: Users should not be able to see the admin skins page

  • Given I am logged in as "skinner"
  • When I go to admin's skins page
  • Then I should see "I'm sorry, only an admin can look at that area"

Scenario: Admin can cache and uncache a public skin

  • Given basic skins
  • And the approved public skin "public skin"
  • And I am logged in as a "superadmin" admin
  • When I follow "Approved Skins"
  • And I check "Cache"
  • And I press "Update"
  • Then I should see "The following skins were updated: public skin"
  • When I follow "Approved Skins"
  • And I check "Uncache"
  • And I press "Update"
  • Then I should see "The following skins were updated: public skin"

Scenario: Admin can add a public skin to the chooser and then remove it

  • Given the approved public skin "public skin"
  • And the skin "public skin" is cached
  • When I am logged in as a "superadmin" admin
  • Then I should not see the skin chooser
  • When I follow "Approved Skins"
  • And I check "Chooser"
  • And I press "Update"
  • Then I should see "The following skins were updated: public skin"
  • And I should see the skin "public skin" in the skin chooser
  • When I follow "Approved Skins"
  • And I check "Not In Chooser"
  • And I press "Update"
  • Then I should see "The following skins were updated: public skin"
  • And I should not see the skin chooser

Scenario: An admin can reject and unreject a skin

  • Given the unapproved public skin "public skin"
  • And I am logged in as a "superadmin" admin
  • When I go to admin's skins page
  • And I check "make_rejected_public_skin"
  • And I submit
  • Then I should see "The following skins were updated: public skin"
  • When I follow "Rejected Skins"
  • Then I should see "public skin"
  • When I check "make_unrejected_public_skin"
  • And I submit
  • Then I should see "The following skins were updated: public skin"
  • When I follow "Rejected Skins"
  • Then I should not see "public skin"

Scenario: An admin can feature and unfeature skin

  • Given the approved public skin "public skin"
  • And I am logged in as a "superadmin" admin
  • When I follow "Approved Skins"
  • And I check "Feature"
  • And I submit
  • Then I should see "The following skins were updated: public skin"
  • When I follow "Approved Skins"
  • And I check "Unfeature"
  • And I submit
  • Then I should see "The following skins were updated: public skin"

Scenario: Admins should be able to see public skins in the admin skins page

  • Given the unapproved public skin "public skin"
  • And I am logged in as a "superadmin" admin
  • When I go to admin's skins page
  • Then I should see "public skin" within "table#unapproved_skins"

Scenario: Admins should not be able to edit unapproved skins

  • Given the unapproved public skin "public skin"
  • And I am logged in as a "superadmin" admin
  • When I go to "public skin" skin page
  • Then I should not see "Edit"
  • And I should not see "Delete"
  • When I go to "public skin" edit skin page
  • Then I should see "Sorry, you don't have permission"

Scenario: Admins should be able to approve public skins

  • Given the unapproved public skin "public skin"
  • And I am logged in as a "superadmin" admin
  • When I go to admin's skins page
  • And I check "public skin"
  • And I submit
  • Then I should see "The following skins were updated: public skin"
  • When I follow "Approved Skins"
  • Then I should see "public skin" within "table#approved_skins"

Scenario: Admins should be able to edit but not delete public approved skins

  • Given the approved public skin "public skin" with css "#title { text-decoration: blink;}"
  • And I am logged in as a "superadmin" admin
  • When I go to "public skin" skin page
  • Then I should see "Edit"
  • But I should not see "Delete"
  • When I follow "Edit"
  • And I fill in "CSS" with "#greeting.logged-in { text-decoration: blink;}"
  • And I fill in "Description" with "Blinky love (admin modified)"
  • And I submit
  • Then I should see an update confirmation message
  • And I should see "(admin modified)"
  • And I should see "#greeting.logged-in"
  • And I should not see "#title"
  • Then the cache of the skin on "public skin" should expire after I save the skin

Scenario: Admins should be able to unapprove public skins, which should also

remove them from preferences

  • Given "skinuser" is using the approved public skin "public skin" with css "#title { text-decoration: blink;}"
  • When I unapprove the skin "public skin"
  • Then I should see "The following skins were updated: public skin"
  • And I should see "public skin" within "table#unapproved_skins"
  • When I am logged in as "skinuser"
  • And I am on skinuser's preferences page
  • Then "Default" should be selected within "preference_skin_id"
  • And I should not see "#title"
  • And I should not see "text-decoration: blink;"

Scenario: Admin can edit a skin with the word "archive" in the title

  • Given the approved public skin "official archive skin" has reserved words in the title
  • And I am logged in as a "superadmin" admin
  • When I go to "official archive skin" skin page
  • And I follow "Edit"
  • And I fill in "CSS" with "#greeting.logged-in { text-decoration: blink;}"
  • And I fill in "Description" with "all your skin are belong to us"
  • And I submit
  • Then I should see an update confirmation message
  • And I should see "all your skin are belong to us"
  • And I should see "#greeting.logged-in"

Source: features/admins/admin_skins.feature at commit f09caa86, Otwarchive (GPL license).