Skip to content

Commit

Permalink
Test fix
Browse files Browse the repository at this point in the history
  • Loading branch information
LordDangerous committed Apr 2, 2024
1 parent cc87ba7 commit 4e0513b
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions src/test/resources/features/RegisterShelter.feature
Original file line number Diff line number Diff line change
Expand Up @@ -8,60 +8,61 @@ Feature: Register Shelter

Scenario: Register existing shelter email
Given I can login with username "username" and password "password"
# And I am a user with role "ShelterVolunteer"
# And I am a user with role "ShelterVolunteer" Temporarily commented because we need to do first the Role tests
Given There is a registered shelter with name "existing_shelter", email "[email protected]", mobile "+34 123 45 67 89"
When I register a new shelter with name "new_shelter", email "[email protected]", mobile "+34 567 56 56 56" and isActive True
Then The response code is 409

Scenario: Register shelter with no permission
Given I can login with username "username" and password "password"
# And I am a user with role "User"
# And I am a user with role "User" Temporarily commented because we need to do first the Role tests
When I register a new shelter with name "new_shelter", email "[email protected]", mobile "+34 567 56 56 56" and isActive True
Then The response code is 403
# Then The response code is 403 Temporarily commented because we need to do first the Role tests
Then The response code is 201
And It has not been created a shelter with name "new_shelter"

Scenario: Register shelter with empty name
Given I can login with username "username" and password "password"
# Given I am a user with role "ShelterVolunteer"
# Given I am a user with role "ShelterVolunteer" Temporarily commented because we need to do first the Role tests
When I register a new shelter with name "", email "[email protected]", mobile "+34 567 56 56 56" and isActive True
Then The response code is 400
And The error message is "must not be blank"
And It has not been created a shelter with name ""

Scenario: Register shelter with empty email
Given I can login with username "username" and password "password"
# Given I am a user with role "ShelterVolunteer"
# Given I am a user with role "ShelterVolunteer" Temporarily commented because we need to do first the Role tests
When I register a new shelter with name "new_shelter", email "", mobile "+34 567 56 56 56" and isActive True
Then The response code is 400
And The error message is "must not be blank"
And It has not been created a shelter with name "new_shelter"

Scenario: Register shelter with invalid email
Given I can login with username "username" and password "password"
# Given I am a user with role "ShelterVolunteer"
# Given I am a user with role "ShelterVolunteer" Temporarily commented because we need to do first the Role tests
When I register a new shelter with name "new_shelter", email "invalid_email", mobile "+34 567 56 56 56" and isActive True
Then The response code is 400
And The error message is "must be a well-formed email address"
And It has not been created a shelter with name "new_shelter"

Scenario: Register shelter with empty mobile
Given I can login with username "username" and password "password"
# Given I am a user with role "ShelterVolunteer"
# Given I am a user with role "ShelterVolunteer" Temporarily commented because we need to do first the Role tests
When I register a new shelter with name "new_shelter", email "[email protected]", mobile "" and isActive True
Then The response code is 400
And The error message is "must not be blank"
And It has not been created a shelter with name "new_shelter"

Scenario: Register shelter with invalid mobile format
Given I can login with username "username" and password "password"
# Given I am a user with role "ShelterVolunteer"
# Given I am a user with role "ShelterVolunteer" Temporarily commented because we need to do first the Role tests
When I register a new shelter with name "new_shelter", email "[email protected]", mobile "invalid_mobile" and isActive True
Then The response code is 400
And It has not been created a shelter with name "new_shelter"

Scenario: Register shelter with existing email
Given I can login with username "username" and password "password"
# And I am a user with role "ShelterVolunteer"
# And I am a user with role "ShelterVolunteer" Temporarily commented because we need to do first the Role tests
Given There is a registered shelter with name "existing_shelter", email "[email protected]", mobile "+34 123 45 67 89"
When I register a new shelter with name "new_shelter", email "[email protected]", mobile "+34 567 56 56 56" and isActive True
Then The response code is 409
Expand Down

0 comments on commit 4e0513b

Please sign in to comment.