Skip to content

Instantly share code, notes, and snippets.

@mario-rezende-ifood
Last active November 21, 2019 01:03
Show Gist options
  • Save mario-rezende-ifood/1cc87d8ac8e2217918de0c1fa2e9a69f to your computer and use it in GitHub Desktop.
Save mario-rezende-ifood/1cc87d8ac8e2217918de0c1fa2e9a69f to your computer and use it in GitHub Desktop.
def 'Allow user access only for 18 over'(name, age, expected) {
given: 'user entity'
def user = new User(name, age)
when: 'validate user access'
def userCanAccess = AccessService().grantUser(user)
then:
userCanAccess == expected
where:
name | age | expected
'Fulano' | 18 | true
'Beltrano' | 19 | true
'Sicrano' | 17 | false
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment