generated from JetBrains/intellij-platform-plugin-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
mikrise2
committed
Dec 19, 2023
1 parent
ce22d0c
commit b6db66d
Showing
4 changed files
with
25 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,7 +16,7 @@ class UserRequestTest { | |
fun singleCreationTest() = testApplicationRouted { | ||
val id = client.createUserRequest("example", "[email protected]") | ||
.apply { | ||
assertEquals(HttpStatusCode.Created, status) | ||
assertEquals(HttpStatusCode.OK, status) | ||
}.body<Int>() | ||
transaction { | ||
val user = User.findById(id) | ||
|
@@ -30,11 +30,11 @@ class UserRequestTest { | |
fun multiCreationTest() = testApplicationRouted { | ||
val id1 = client.createUserRequest("example1", "[email protected]") | ||
.apply { | ||
assertEquals(HttpStatusCode.Created, status) | ||
assertEquals(HttpStatusCode.OK, status) | ||
}.body<Int>() | ||
val id2 = client.createUserRequest("example2", "[email protected]") | ||
.apply { | ||
assertEquals(HttpStatusCode.Created, status) | ||
assertEquals(HttpStatusCode.OK, status) | ||
}.body<Int>() | ||
transaction { | ||
assertNotNull(User.findById(id1)) | ||
|
@@ -48,19 +48,19 @@ class UserRequestTest { | |
val size = transaction { User.all().count() } | ||
client.createUserRequest("example", "[email protected]") | ||
.apply { | ||
assertEquals(HttpStatusCode.Created, status) | ||
assertEquals(HttpStatusCode.OK, status) | ||
} | ||
transaction { | ||
assertEquals(size, User.all().count()) | ||
} | ||
} | ||
|
||
@Test | ||
fun `creation with same email test`() = testApplicationRouted { | ||
fun `creation with same email and name test`() = testApplicationRouted { | ||
client.createUserRequest("example", "[email protected]") | ||
val size = transaction { User.all().count() } | ||
client.createUserRequest("another", "[email protected]").apply { | ||
assertEquals(HttpStatusCode.BadRequest, status) | ||
client.createUserRequest("example", "[email protected]").apply { | ||
assertEquals(HttpStatusCode.OK, status) | ||
} | ||
transaction { | ||
assertEquals(size, User.all().count()) | ||
|