Skip to content

Commit

Permalink
revert user statusCreated change for now
Browse files Browse the repository at this point in the history
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
  • Loading branch information
butonic committed Dec 8, 2022
1 parent 4a51642 commit 8f00f63
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion services/graph/pkg/service/v0/users.go
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ func (g Graph) PostUser(w http.ResponseWriter, r *http.Request) {
}
g.publishEvent(e)

render.Status(r, http.StatusCreated)
render.Status(r, http.StatusOK)
render.JSON(w, r, u)
}

Expand Down
2 changes: 1 addition & 1 deletion services/graph/pkg/service/v0/users_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ var _ = Describe("Users", func() {
r = r.WithContext(revactx.ContextSetUser(ctx, currentUser))
svc.PostUser(rr, r)

Expect(rr.Code).To(Equal(http.StatusCreated))
Expect(rr.Code).To(Equal(http.StatusOK))
})
})

Expand Down
6 changes: 3 additions & 3 deletions tests/acceptance/features/apiGraph/createUser.feature
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ Feature: create user
And user "<userName>" <shouldOrNot> exist
Examples:
| userName | displayName | email | password | code | shouldOrNot |
| SameDisplayName | Alice Hansen | new@example.org | containsCharacters(*:!;_+-&) | 201 | should |
| withoutPassSameEmail | without pass | alice@example.org | | 201 | should |
| name | pass with space | example@example.org | my pass | 201 | should |
| SameDisplayName | Alice Hansen | new@example.org | containsCharacters(*:!;_+-&) | 200 | should |
| withoutPassSameEmail | without pass | alice@example.org | | 200 | should |
| name | pass with space | example@example.org | my pass | 200 | should |
| nameWithCharacters(*:!;_+-&) | user | new@example.org | 123 | 400 | should not |
| withoutEmail | without email | | 123 | 400 | should not |
| Alice | same userName | new@example.org | 123 | 400 | should |
Expand Down
4 changes: 2 additions & 2 deletions tests/acceptance/features/bootstrap/GraphContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -540,7 +540,7 @@ public function theAdminHasCreatedUser(
$email,
$displayName
);
if ($response->getStatusCode() !== 201) {
if ($response->getStatusCode() !== 200) {
$this->throwHttpException($response, "Could not create user $user");
} else {
$this->featureContext->setResponse($response);
Expand Down Expand Up @@ -600,7 +600,7 @@ public function theUserHasCreatedANewUserUsingGraphapiWithTheFollowingSettings(s
$rows = $table->getRowsHash();
$response = $this->featureContext->getResponse();

if ($response->getStatusCode() !== 201) {
if ($response->getStatusCode() !== 200) {
$this->throwHttpException($response, "Could not create user '$rows[userName]'");
}
}
Expand Down

0 comments on commit 8f00f63

Please sign in to comment.