Skip to content

Commit 8fab7fb

Browse files
authored
Merge pull request #413 from Art4/support-for-many-issuecategories
Support for many issue_categories
2 parents 3de40b4 + d3e35ba commit 8fab7fb

File tree

2 files changed

+44
-23
lines changed

2 files changed

+44
-23
lines changed

tests/Behat/Bootstrap/IssueCategoryContextTrait.php

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,34 @@
99

1010
trait IssueCategoryContextTrait
1111
{
12+
/**
13+
* @Given I create :count issue categories for project identifier :identifier
14+
*/
15+
public function iCreateIssueCategoriesForProjectIdentifier(int $count, $identifier)
16+
{
17+
while ($count > 0) {
18+
$this->iCreateAnIssueCategoryForProjectIdentifierAndWithTheName(
19+
$identifier,
20+
'Issue Category ' . $count,
21+
);
22+
23+
$count--;
24+
}
25+
}
26+
27+
/**
28+
* @When I create an issue category for project identifier :identifier and with the name :name
29+
*/
30+
public function iCreateAnIssueCategoryForProjectIdentifierAndWithTheName($identifier, $name)
31+
{
32+
$table = new TableNode([
33+
['property', 'value'],
34+
['name', $name],
35+
]);
36+
37+
$this->iCreateAnIssueCategoryForProjectIdentifierAndWithTheFollowingData($identifier, $table);
38+
}
39+
1240
/**
1341
* @When I create an issue category for project identifier :identifier and with the following data
1442
*/

tests/Behat/features/issue_category.feature

Lines changed: 16 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@ Feature: Interacting with the REST API for issue categories
77
Scenario: Creating an issue category with miminal data
88
Given I have a "NativeCurlClient" client
99
And I create a project with name "Test Project" and identifier "test-project"
10-
When I create an issue category for project identifier "test-project" and with the following data
11-
| property | value |
12-
| name | Category name |
10+
When I create an issue category for project identifier "test-project" and with the name "Category name"
1311
Then the response has the status code "201"
1412
And the response has the content type "application/xml"
1513
And the returned data is an instance of "SimpleXMLElement"
@@ -101,12 +99,8 @@ Feature: Interacting with the REST API for issue categories
10199
Scenario: Listing of multiple issue categories
102100
Given I have a "NativeCurlClient" client
103101
And I create a project with name "Test Project" and identifier "test-project"
104-
And I create an issue category for project identifier "test-project" and with the following data
105-
| property | value |
106-
| name | Category name B |
107-
And I create an issue category for project identifier "test-project" and with the following data
108-
| property | value |
109-
| name | Category name A |
102+
And I create an issue category for project identifier "test-project" and with the name "Category name B"
103+
And I create an issue category for project identifier "test-project" and with the name "Category name A"
110104
When I list all issue categories for project identifier "test-project"
111105
Then the response has the status code "200"
112106
And the response has the content type "application/json"
@@ -154,12 +148,8 @@ Feature: Interacting with the REST API for issue categories
154148
Scenario: Listing of multiple issue category names
155149
Given I have a "NativeCurlClient" client
156150
And I create a project with name "Test Project" and identifier "test-project"
157-
And I create an issue category for project identifier "test-project" and with the following data
158-
| property | value |
159-
| name | Category name B |
160-
And I create an issue category for project identifier "test-project" and with the following data
161-
| property | value |
162-
| name | Category name A |
151+
And I create an issue category for project identifier "test-project" and with the name "Category name B"
152+
And I create an issue category for project identifier "test-project" and with the name "Category name A"
163153
When I list all issue category names for project identifier "test-project"
164154
Then the response has the status code "200"
165155
And the response has the content type "application/json"
@@ -168,13 +158,19 @@ Feature: Interacting with the REST API for issue categories
168158
| 1 | Category name B |
169159
| 2 | Category name A |
170160

161+
Scenario: Listing a lot of issue category names
162+
Given I have a "NativeCurlClient" client
163+
And I create a project with name "Test Project" and identifier "test-project"
164+
And I create "108" issue categories for project identifier "test-project"
165+
When I list all issue category names for project identifier "test-project"
166+
Then the response has the status code "200"
167+
And the response has the content type "application/json"
168+
And the returned data contains "108" items
169+
171170
Scenario: Updating an issue category with all data
172171
Given I have a "NativeCurlClient" client
173172
And I create a project with name "Test Project" and identifier "test-project"
174-
And I create an issue category for project identifier "test-project" and with the following data
175-
| property | value |
176-
| name | Category name |
177-
| assigned_to_id | 1 |
173+
And I create an issue category for project identifier "test-project" and with the name "Category name"
178174
When I update the issue category with id "1" and the following data
179175
| property | value |
180176
| name | New category name |
@@ -187,10 +183,7 @@ Feature: Interacting with the REST API for issue categories
187183
Scenario: Deleting an issue category
188184
Given I have a "NativeCurlClient" client
189185
And I create a project with name "Test Project" and identifier "test-project"
190-
And I create an issue category for project identifier "test-project" and with the following data
191-
| property | value |
192-
| name | Category name |
193-
| assigned_to_id | 1 |
186+
And I create an issue category for project identifier "test-project" and with the name "Category name"
194187
When I remove the issue category with id "1"
195188
Then the response has the status code "204"
196189
And the response has an empty content type

0 commit comments

Comments
 (0)