103 lines
4.8 KiB
Gherkin
103 lines
4.8 KiB
Gherkin
Feature: Stay Management
|
|
|
|
Scenario: Submit a stay request as community member
|
|
Given a user "member@test.org" exists with roles "community_member"
|
|
And I login as "member@test.org"
|
|
When I submit a stay request with type "volunteer" from "2026-06-01" to "2026-06-15"
|
|
Then the response status should be 200
|
|
And the response body field "status" should be "submitted"
|
|
And I store the response field "requestId" as "requestId"
|
|
|
|
Scenario: Approve a stay request as coordinator
|
|
Given a user "member@test.org" exists with roles "community_member"
|
|
And I login as "member@test.org"
|
|
When I submit a stay request with type "volunteer" from "2026-07-01" to "2026-07-15"
|
|
Then the response status should be 200
|
|
And I store the response field "requestId" as "requestId"
|
|
Given I login as "admin@perauset.org"
|
|
When I approve the stay request
|
|
Then the response status should be 200
|
|
And the response body field "status" should be "approved"
|
|
|
|
Scenario: Create stay from approved request
|
|
Given a user "member@test.org" exists with roles "community_member"
|
|
And I login as "member@test.org"
|
|
When I submit a stay request with type "guest" from "2026-08-01" to "2026-08-10"
|
|
Then the response status should be 200
|
|
And I store the response field "requestId" as "requestId"
|
|
Given I login as "admin@perauset.org"
|
|
When I approve the stay request
|
|
Then the response status should be 200
|
|
When I create a stay from the approved request
|
|
Then the response status should be 200
|
|
And the response body field "status" should be "pending"
|
|
And I store the response field "stayId" as "stayId"
|
|
|
|
Scenario: Check in and check out a stay
|
|
Given a user "member@test.org" exists with roles "community_member"
|
|
And I login as "member@test.org"
|
|
When I submit a stay request with type "volunteer" from "2026-09-01" to "2026-09-10"
|
|
Then the response status should be 200
|
|
And I store the response field "requestId" as "requestId"
|
|
Given I login as "admin@perauset.org"
|
|
When I approve the stay request
|
|
Then the response status should be 200
|
|
When I create a stay from the approved request
|
|
Then the response status should be 200
|
|
And I store the response field "stayId" as "stayId"
|
|
Given the stay is confirmed in the database
|
|
When I check in the stay
|
|
Then the response status should be 200
|
|
And the response body field "status" should be "checked_in"
|
|
When I check out the stay
|
|
Then the response status should be 200
|
|
And the response body field "status" should be "checked_out"
|
|
|
|
Scenario: Reject a stay request
|
|
Given a user "member@test.org" exists with roles "community_member"
|
|
And I login as "member@test.org"
|
|
When I submit a stay request with type "day_visit" from "2026-10-01" to "2026-10-01"
|
|
Then the response status should be 200
|
|
And I store the response field "requestId" as "requestId"
|
|
Given I login as "admin@perauset.org"
|
|
When I reject the stay request with reason "Not available"
|
|
Then the response status should be 200
|
|
And the response body field "status" should be "rejected"
|
|
|
|
Scenario: Invalid transition - reject an already approved request
|
|
Given a user "member@test.org" exists with roles "community_member"
|
|
And I login as "member@test.org"
|
|
When I submit a stay request with type "volunteer" from "2026-11-01" to "2026-11-10"
|
|
Then the response status should be 200
|
|
And I store the response field "requestId" as "requestId"
|
|
Given I login as "admin@perauset.org"
|
|
When I approve the stay request
|
|
Then the response status should be 200
|
|
When I reject the stay request with reason "Changed mind"
|
|
Then the response status should be 409
|
|
|
|
Scenario: Unpermissioned user cannot approve requests
|
|
Given a user "member@test.org" exists with roles "community_member"
|
|
And I login as "member@test.org"
|
|
When I submit a stay request with type "volunteer" from "2026-12-01" to "2026-12-10"
|
|
Then the response status should be 200
|
|
And I store the response field "requestId" as "requestId"
|
|
Given a user "guest@test.org" exists with roles "guest"
|
|
And I login as "guest@test.org"
|
|
When I approve the stay request
|
|
Then the response status should be 403
|
|
|
|
Scenario: Unpermissioned user cannot create stays
|
|
Given a user "member@test.org" exists with roles "community_member"
|
|
And I login as "member@test.org"
|
|
When I submit a stay request with type "volunteer" from "2027-01-01" to "2027-01-10"
|
|
Then the response status should be 200
|
|
And I store the response field "requestId" as "requestId"
|
|
Given I login as "admin@perauset.org"
|
|
When I approve the stay request
|
|
Then the response status should be 200
|
|
Given a user "guest@test.org" exists with roles "guest"
|
|
And I login as "guest@test.org"
|
|
When I create a stay from the approved request
|
|
Then the response status should be 403
|