Skip to content

Instantly share code, notes, and snippets.

@james-prickett
Created April 1, 2011 17:12
Show Gist options
  • Select an option

  • Save james-prickett/898491 to your computer and use it in GitHub Desktop.

Select an option

Save james-prickett/898491 to your computer and use it in GitHub Desktop.
Security Specification w/ Spock and Geb
def "Restrict users with the view permission"() {
when: "The user attempts to access an edit page"
login "viewuser", "password", MyReportsPage
then: "The user is shown an error message"
$().text().contains(AUTHORIZATION_ERROR_MSG)
when: "The user attempts to access an admin page"
to AdminPage
then: "The user is shown an error message"
$().text().contains(AUTHORIZATION_ERROR_MSG)
when: "The user attempts to access the create report page"
to CreateReportPage
then: "The user is shown an error message"
$().text().contains(AUTHORIZATION_ERROR_MSG)
when: "The user attempts to access the users page"
to UsersPage
then: "The user is shown an error message"
$().text().contains(AUTHORIZATION_ERROR_MSG)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment