Skip to content

Commit

Permalink
Create behat tests for CustomField::listNames()
Browse files Browse the repository at this point in the history
  • Loading branch information
Art4 committed Jun 28, 2024
1 parent 4e7e133 commit f4bd056
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/Behat/Bootstrap/CustomFieldContextTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,18 @@ public function iListAllCustomFields()
$api->getLastResponse(),
);
}

/**
* @When I list all custom field names
*/
public function iListAllCustomFieldNames()
{
/** @var CustomField */
$api = $this->getNativeCurlClient()->getApi('custom_fields');

$this->registerClientResponse(
$api->listNames(),
$api->getLastResponse(),
);
}
}
14 changes: 14 additions & 0 deletions tests/Behat/features/custom_field.feature
Original file line number Diff line number Diff line change
Expand Up @@ -101,3 +101,17 @@ Feature: Interacting with the REST API for custom fields
| visible | true |
| trackers | [] |
| roles | [] |

Scenario: Listing of multiple custom field names
Given I have a "NativeCurlClient" client
And I create a custom field for issues with the name "Note B"
And I create a custom field for issues with the name "Note A"
When I list all custom field names
Then the response has the status code "200"
And the response has the content type "application/json"
And the returned data is an array
And the returned data contains "2" items
And the returned data contains the following data
| property | value |
| 1 | Note B |
| 2 | Note A |

0 comments on commit f4bd056

Please sign in to comment.