dox Executable Documentation

Create user

Create user successfully

Given I am logged in as admin
Given I have entered the name 'Bart Simpson'
Given I have entered the email 'bart@simpson.com'
Given the next generated key is 'key'
When I create a new user
Then the success message should be 'The user Bart Simpson was created.'
Then there should be 1 users
Then there should be a user with the name 'Bart Simpson' the email and the key 'bart@simpson.com' 'key'

Not logged in

Given I have entered the name 'Lisa Simpson'
Given I have entered the email 'lisa@simpson.com'
When I create a new user
Then I should be redirected to 'login.html'

Not admin

Given I am logged as the user 'Homer'
Given I have entered the name 'Lisa Simpson'
Given I have entered the email 'lisa@simpson.com'
When I create a new user
Then the error message should be 'Access denied. Must be administrator.'
Then the new name field should contain 'Lisa Simpson'
Then the email field should contain 'lisa@simpson.com'

Empty name

Given I am logged in as admin
Given I have entered the email 'bart@simpson.com'
When I create a new user
Then the error message should be 'Please provide name and email.'
Then the email field should contain 'bart@simpson.com'

Empty email

Given I am logged in as admin
Given I have entered the name 'Bart Simpson'
When I create a new user
Then the error message should be 'Please provide name and email.'
Then the new name field should contain 'Bart Simpson'

Already existing email

Given I am logged in as admin
Given the user 'El Barto' with the email 'bart@simpson.com'
Given I have entered the name 'Bart Simpson'
Given I have entered the email 'Bart@Simpson.com'
When I create a new user
Then the error message should be 'Error while creating user. The email probably already exists.'
Then the new name field should contain 'Bart Simpson'
Then the email field should contain 'Bart@Simpson.com'

Already existing key

Given I am logged in as admin
Given the user 'Bart Simpson' with the email 'bart@simpson.com' and key 'abc'
Given I have entered the name 'Lisa Simpson'
Given I have entered the email 'lisa@simpson.com'
Given the next generated key is 'def'
Given the next generated key is 'abc'
When I create a new user
Then there should be 2 users
Then there should be a user with the name 'Lisa Simpson' the email and the key 'lisa@simpson.com' 'def'