|
|
|
@ -35,8 +35,9 @@ Feature: Filtering work packages via the api |
|
|
|
|
And the project "sample_project" has the following types: |
|
|
|
|
| name | position | |
|
|
|
|
| Bug | 1 | |
|
|
|
|
| Story | 2 | |
|
|
|
|
| Epic | 3 | |
|
|
|
|
| Task | 2 | |
|
|
|
|
| Story | 3 | |
|
|
|
|
| Epic | 4 | |
|
|
|
|
And there is a default issuepriority with: |
|
|
|
|
| name | Normal | |
|
|
|
|
And there is a issuepriority with: |
|
|
|
@ -60,56 +61,86 @@ Feature: Filtering work packages via the api |
|
|
|
|
And there is 1 user with the following: |
|
|
|
|
| login | bob | |
|
|
|
|
And the user "bob" is a "member" in the project "sample_project" |
|
|
|
|
And I am already logged in as "bob" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
And there are the following work packages in project "sample_project": |
|
|
|
|
Scenario: Call the endpoint of the api without filters |
|
|
|
|
Given there are the following work packages in project "sample_project": |
|
|
|
|
| subject | type | |
|
|
|
|
| work_package#1 | Bug | |
|
|
|
|
| work_package#1.1 | Bug | |
|
|
|
|
| work_package#2 | Story | |
|
|
|
|
| work_package#2.1 | Story | |
|
|
|
|
| work_package#3 | Epic | |
|
|
|
|
| work_package#3.1 | Story | |
|
|
|
|
|
|
|
|
|
And the work package "work_package#1" has the following children: |
|
|
|
|
| work_package#1.1 | |
|
|
|
|
|
|
|
|
|
And the work package "work_package#2" has the following children: |
|
|
|
|
| work_package#2.1 | |
|
|
|
|
|
|
|
|
|
And the work package "work_package#3" has the following children: |
|
|
|
|
| work_package#3.1 | |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
And I am already logged in as "bob" |
|
|
|
|
|
|
|
|
|
Scenario: Call the endpoint of the api without filters |
|
|
|
|
When I call the work_package-api on project "sample_project" requesting format "json" without any filters |
|
|
|
|
Then the json-response should include 6 work packages |
|
|
|
|
Then the json-response should include 2 work packages |
|
|
|
|
And the json-response should contain a work_package "work_package#1" |
|
|
|
|
And the json-response should contain a work_package "work_package#2" |
|
|
|
|
|
|
|
|
|
Scenario: Call the api filtering for type |
|
|
|
|
Given there are the following work packages in project "sample_project": |
|
|
|
|
| subject | type | parent | |
|
|
|
|
| work_package#1 | Bug | | |
|
|
|
|
| work_package#1.1 | Bug | work_package#1 | |
|
|
|
|
| work_package#2 | Story | | |
|
|
|
|
| work_package#2.1 | Story | work_package#2 | |
|
|
|
|
| work_package#3 | Epic | | |
|
|
|
|
| work_package#3.1 | Story | work_package#3 | |
|
|
|
|
When I call the work_package-api on project "sample_project" requesting format "json" filtering for type "Bug" |
|
|
|
|
Then the json-response should include 2 work packages |
|
|
|
|
Then the json-response should not contain a work_package "work_package#2" |
|
|
|
|
And the json-response should contain a work_package "work_package#1" |
|
|
|
|
|
|
|
|
|
Scenario: Filtering multiple types |
|
|
|
|
When I call the work_package-api on project "sample_project" requesting format "json" filtering for type "Bug,Phase" |
|
|
|
|
Then the json-response should include 2 work packages |
|
|
|
|
And the json-response should not contain a work_package "work_package#2" |
|
|
|
|
Given there are the following work packages in project "sample_project": |
|
|
|
|
| subject | type | parent | |
|
|
|
|
| work_package#1 | Bug | | |
|
|
|
|
| work_package#1.1 | Bug | work_package#1 | |
|
|
|
|
| work_package#3 | Epic | | |
|
|
|
|
| work_package#3.1 | Story | work_package#3 | |
|
|
|
|
When I call the work_package-api on project "sample_project" requesting format "json" filtering for type "Bug,Epic" |
|
|
|
|
Then the json-response should include 3 work packages |
|
|
|
|
And the json-response should contain a work_package "work_package#1" |
|
|
|
|
And the json-response should contain a work_package "work_package#3" |
|
|
|
|
And the json-response should not contain a work_package "work_package#3.1" |
|
|
|
|
|
|
|
|
|
Scenario: Filter out children of work packages, if they don't have the right type |
|
|
|
|
Given there are the following work packages in project "sample_project": |
|
|
|
|
| subject | type | parent | |
|
|
|
|
| work_package#3 | Epic | | |
|
|
|
|
| work_package#3.1 | Story | work_package#3 | |
|
|
|
|
When I call the work_package-api on project "sample_project" requesting format "json" filtering for type "Epic" |
|
|
|
|
Then the json-response should include 1 work package |
|
|
|
|
And the json-response should contain a work_package "work_package#3" |
|
|
|
|
And the json-response should not contain a work_package "work_package#3.1" |
|
|
|
|
|
|
|
|
|
Scenario: Filter out parents of work packages, if they don't have the right type |
|
|
|
|
Given there are the following work packages in project "sample_project": |
|
|
|
|
| subject | type | |
|
|
|
|
| work_package#1 | Bug | |
|
|
|
|
| work_package#2 | Story | |
|
|
|
|
When I call the work_package-api on project "sample_project" requesting format "json" filtering for type "Story" |
|
|
|
|
Then the json-response should include 1 work package |
|
|
|
|
And the json-response should not contain a work_package "work_package#1" |
|
|
|
|
And the json-response should contain a work_package "work_package#2" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Scenario: correctly export parent-child-relations |
|
|
|
|
Given there are the following work packages in project "sample_project": |
|
|
|
|
| subject | type | parent | |
|
|
|
|
| work_package#1 | Epic | | |
|
|
|
|
| work_package#1.1 | Story | work_package#1 | |
|
|
|
|
| work_package#2 | Task | work_package#1.1 | |
|
|
|
|
When I call the work_package-api on project "sample_project" requesting format "json" without any filters |
|
|
|
|
Then the json-response should include 3 work packages |
|
|
|
|
And the json-response should not contain a work_package "work_package#3" |
|
|
|
|
And the json-response should contain a work_package "work_package#3.1" |
|
|
|
|
And the json-response should say that "work_package#1" is parent of "work_package#1.1" |
|
|
|
|
|
|
|
|
|
Scenario: Move parent-relations up the ancestor-chain, when intermediate packages are fitered |
|
|
|
|
Given there are the following work packages in project "sample_project": |
|
|
|
|
| subject | type | parent | |
|
|
|
|
| work_package#1 | Epic | | |
|
|
|
|
| work_package#1.1 | Story | work_package#1 | |
|
|
|
|
| work_package#1.1.1 | Task | work_package#1.1 | |
|
|
|
|
When I call the work_package-api on project "sample_project" requesting format "json" filtering for type "Epic,Task" |
|
|
|
|
Then the json-response should include 2 work packages |
|
|
|
|
And the json-response should not contain a work_package "work_package#1.1" |
|
|
|
|
And the json-response should contain a work_package "work_package#1" |
|
|
|
|
And the json-response should contain a work_package "work_package#1.1.1" |
|
|
|
|
And the json-response should say that "work_package#1" is parent of "work_package#1.1.1" |
|
|
|
|
|
|
|
|
|