Skip to content
This repository has been archived by the owner on Jul 24, 2021. It is now read-only.

Commit

Permalink
fix status_is test
Browse files Browse the repository at this point in the history
- was documenting the wrong thing
- 201 *can* have content, and some of our responses do
  • Loading branch information
karenetheridge committed Dec 3, 2020
1 parent 11b76ee commit 1edee76
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion docs/modules/Test::Conch.md
Expand Up @@ -66,7 +66,7 @@ Wrapper around ["status\_is" in Test::Mojo](https://metacpan.org/pod/Test%3A%3AM
3.1. 2xx and 4xx JSON responses should have a Link header
4. HEAD requests should not have body content
5. 200, 203, 206, 207 and most 4xx responses should have body content
6. 201, 204, 205 and most 3xx responses should not have body content
6. 204, 205 and most 3xx responses should not have body content
7. 302 should not be used at all
8. 401, 403 responses should have a WWW-Authenticate header
```
Expand Down
4 changes: 2 additions & 2 deletions lib/Test/Conch.pm
Expand Up @@ -239,7 +239,7 @@ Wrapper around L<Test::Mojo/status_is>, adding some additional checks.
3.1. 2xx and 4xx JSON responses should have a Link header
4. HEAD requests should not have body content
5. 200, 203, 206, 207 and most 4xx responses should have body content
6. 201, 204, 205 and most 3xx responses should not have body content
6. 204, 205 and most 3xx responses should not have body content
7. 302 should not be used at all
8. 401, 403 responses should have a WWW-Authenticate header
Expand Down Expand Up @@ -287,7 +287,7 @@ sub status_is ($self, $status, $desc = undef) {

# 6.
$self->test('fail', $code.' responses should not have content')
if any { $code == $_ } 204,301,302,303,304,305,307,308 and $self->tx->res->text;
if any { $code == $_ } 204,205,301,302,303,304,305,307,308 and $self->tx->res->text;

# 7.
$self->test('fail', 'HTTP 302 is superseded by 303 and 307')
Expand Down

0 comments on commit 1edee76

Please sign in to comment.