Skip to content

Commit 64401f9

Browse files
committed
udpated docs
1 parent 7e01a5b commit 64401f9

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

docs/10-APITesting.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ If API endpoint accepts JSON you can use a `send` methods with `AsJson` suffix t
105105
$I->sendPostAsJson('/users', ['name' => 'old name']);
106106
$users = $I->sendGetAsJson('/users');
107107
$I->sendPutAsJson('/users/' . $users[0]['id'], ['name' => 'new name']);
108-
$I->sendDeleteAsJson('/users/' . $users[1]);
108+
$I->sendDeleteAsJson('/users/' . $users[1]['id']);
109109
{% endhighlight %}
110110

111111
To enable steps with `AsJson` suffix enable `Codeception\Step\AsJson` step decorator in suite config:
@@ -119,7 +119,6 @@ and rebuild actions:
119119

120120
```
121121
php vendor/bin/codecept build
122-
123122
```
124123

125124
> `sendGetAsJson`, `sendPutAsJson`, and others, are implemented with a [Step Decorator](https://codeception.com/docs/08-Customization#Step-Decorators). It adds `application/json` Content-Type, checks JSON response and returns JSON response as associative array.

0 commit comments

Comments
 (0)