Skip to content

Commit fa595a1

Browse files
committed
Add local user-creation transcripts
1 parent 14127b2 commit fa595a1

4 files changed

Lines changed: 32 additions & 0 deletions

File tree

transcripts/run-transcripts.zsh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ transcripts=(
1616
contribution-merge transcripts/share-apis/contribution-merge/
1717
search transcripts/share-apis/search/
1818
users transcripts/share-apis/users/
19+
user-creation transcripts/share-apis/user-creation/
1920
contribution-diffs transcripts/share-apis/contribution-diffs/
2021
definition-diffs transcripts/share-apis/definition-diffs/
2122
tickets transcripts/share-apis/tickets/
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"status_code": 200, "result_url": "http://localhost:1234/?event=new-user-log-in"}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"body": {
3+
"avatarUrl": "https://avatars.githubusercontent.com/u/0?v=4",
4+
"completedTours": [],
5+
"handle": "localgithubuser",
6+
"name": "Local Github User",
7+
"organizationMemberships": [],
8+
"primaryEmail": "local@example.com",
9+
"userId": "U-<UUID>"
10+
},
11+
"status": [
12+
{
13+
"status_code": 200
14+
}
15+
]
16+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/usr/bin/env zsh
2+
3+
set -e
4+
5+
source "../../transcript_helpers.sh"
6+
7+
# Create a cookie jar we can use to store cookies for the new user we're goin to create.
8+
new_user_cookie_jar=$(cookie_jar_for_user_id "new_user")
9+
10+
# Should be able to create a new user via the login flow by following redirects.
11+
curl -s -L -I -o /dev/null -w '{"status_code": %{http_code}, "result_url": "%{url_effective}"}' --request "GET" --cookie "$new_user_cookie_jar" --cookie-jar "$new_user_cookie_jar" "localhost:5424/login" > ./new-user-login.json
12+
13+
# user should now be logged in as the local github user.
14+
fetch "new_user" GET new-user-profile /account

0 commit comments

Comments
 (0)