Skip to content

Commit f4bd056

Browse files
committed
Create behat tests for CustomField::listNames()
1 parent 4e7e133 commit f4bd056

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

tests/Behat/Bootstrap/CustomFieldContextTrait.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,4 +57,18 @@ public function iListAllCustomFields()
5757
$api->getLastResponse(),
5858
);
5959
}
60+
61+
/**
62+
* @When I list all custom field names
63+
*/
64+
public function iListAllCustomFieldNames()
65+
{
66+
/** @var CustomField */
67+
$api = $this->getNativeCurlClient()->getApi('custom_fields');
68+
69+
$this->registerClientResponse(
70+
$api->listNames(),
71+
$api->getLastResponse(),
72+
);
73+
}
6074
}

tests/Behat/features/custom_field.feature

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,3 +101,17 @@ Feature: Interacting with the REST API for custom fields
101101
| visible | true |
102102
| trackers | [] |
103103
| roles | [] |
104+
105+
Scenario: Listing of multiple custom field names
106+
Given I have a "NativeCurlClient" client
107+
And I create a custom field for issues with the name "Note B"
108+
And I create a custom field for issues with the name "Note A"
109+
When I list all custom field names
110+
Then the response has the status code "200"
111+
And the response has the content type "application/json"
112+
And the returned data is an array
113+
And the returned data contains "2" items
114+
And the returned data contains the following data
115+
| property | value |
116+
| 1 | Note B |
117+
| 2 | Note A |

0 commit comments

Comments
 (0)