diff --git a/tests/integration/features/bootstrap/BoardContext.php b/tests/integration/features/bootstrap/BoardContext.php index a423acab4..f30a644bc 100644 --- a/tests/integration/features/bootstrap/BoardContext.php +++ b/tests/integration/features/bootstrap/BoardContext.php @@ -219,6 +219,17 @@ class BoardContext implements Context { $this->card = json_decode((string)$this->getResponse()->getBody(), true); } + /** + * @Given /^get the card details$/ + */ + public function getCard() { + $this->requestContext->sendJSONrequest('GET', '/index.php/apps/deck/cards/' . $this->card['id'], array_merge( + $this->card + )); + $this->requestContext->getResponse()->getBody()->seek(0); + $this->card = json_decode((string)$this->getResponse()->getBody(), true); + } + /** * @Given /^set the card duedate to "([^"]*)"$/ */ diff --git a/tests/integration/features/decks.feature b/tests/integration/features/decks.feature index 22a74baec..474ba61e3 100644 --- a/tests/integration/features/decks.feature +++ b/tests/integration/features/decks.feature @@ -32,3 +32,29 @@ Feature: decks And creates a board named "MyBoard" with color "000000" And create a stack named "ToDo" When create a card named "This is a very ong name that exceeds the maximum length of a deck board created which is longer than 255 characters This is a very ong name that exceeds the maximum length of a deck board created which is longer than 255 characters This is a very ong name that exceeds the maximum length of a deck board created which is longer than 255 characters" + + Scenario: Setting a duedate on a card + Given acting as user "user0" + And creates a board named "MyBoard" with color "000000" + And create a stack named "ToDo" + And create a card named "Overdue task" + When get the card details + And the response should be a JSON array with the following mandatory values + |key|value| + |title|Overdue task| + |duedate|| + |overdue|0| + And set the card attribute "duedate" to "2020-12-12 13:37:00" + When get the card details + And the response should be a JSON array with the following mandatory values + |key|value| + |title|Overdue task| + |duedate|2020-12-12T13:37:00+00:00| + |overdue|3| + And set the card attribute "duedate" to "" + When get the card details + And the response should be a JSON array with the following mandatory values + |key|value| + |title|Overdue task| + |duedate|| + |overdue|0|