-
Notifications
You must be signed in to change notification settings - Fork 8
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
Showing
9 changed files
with
180 additions
and
83 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
on: workflow_dispatch | ||
|
||
on: | ||
push: | ||
branches: [release] | ||
jobs: | ||
publish: | ||
runs-on: ubuntu-latest | ||
|
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
The purpose of this project is to demonstrate selfie for the manual. | ||
|
||
Go to [https://selfie.dev/jvm/advanced](https://selfie.dev/jvm/advanced). |
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,28 +16,52 @@ | |
@JoobyTest(Dev.class) | ||
@TestMethodOrder(MethodOrderer.MethodName.class) | ||
public class AccountTest { | ||
@Test | ||
public void homepage() { | ||
expectSelfie(get("/").body().asString()) | ||
.toBe( | ||
""" | ||
<html><body> | ||
\s <h1>Please login</h1> | ||
\s <form action="/login" method="post"> | ||
\s <input type="text" name="email" placeholder="email"> | ||
\s <input type="submit" value="login"> | ||
\s </form> | ||
</body></html>"""); | ||
} | ||
|
||
@Test | ||
public void T01_not_logged_in() { | ||
expectSelfie(get("/")) | ||
.toBe( | ||
""" | ||
<html><body> | ||
<h1>Please login</h1> | ||
<form action="/login" method="post"> | ||
<input type="text" name="email" placeholder="email"> | ||
<input type="submit" value="login"> | ||
</form> | ||
</body></html>"""); | ||
<html><body> | ||
\s <h1>Please login</h1> | ||
\s <form action="/login" method="post"> | ||
\s <input type="text" name="email" placeholder="email"> | ||
\s <input type="submit" value="login"> | ||
\s </form> | ||
</body></html> | ||
╔═ [statusLine] ═╗ | ||
HTTP/1.1 200 OK"""); | ||
} | ||
|
||
@Test | ||
public void T02_login(Jooby app) { | ||
expectSelfie(given().param("email", "[email protected]").post("/login")) | ||
.toBe( | ||
"<html><body><h1>Email sent!</h1><p>Check your email for your login link.</p></body></html>"); | ||
""" | ||
<html><body><h1>Email sent!</h1><p>Check your email for your login link.</p></body></html> | ||
╔═ [statusLine] ═╗ | ||
HTTP/1.1 200 OK"""); | ||
var email = EmailDev.waitForIncoming(app); | ||
expectSelfie(email) | ||
.toBe("Click <a href=\"http://localhost:8911/login-confirm/erjchFY=\">here</a> to login."); | ||
.toBe( | ||
""" | ||
Click <a href="http://localhost:8911/login-confirm/erjchFY=">here</a> to login. | ||
╔═ [metadata] ═╗ | ||
subject=Login to example.com | ||
[email protected] [email protected]"""); | ||
} | ||
|
||
@Test | ||
|
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