refactor: rename Alice to Nina across test and seed scripts
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
@@ -35,7 +35,7 @@ func TestAdminUsers_List(t *testing.T) {
|
||||
_, err := db.DB.Exec(context.Background(), `
|
||||
INSERT INTO users (n_first_name, n_last_name, email, phone, date_of_birth, password_hash, account_role, account_type)
|
||||
VALUES
|
||||
('Alice', 'Smith', 'alice@test.com', '+447123456789', '1990-01-01', 'hash1', 'admin', 'email'),
|
||||
('Nina', 'Smith', 'nina@test.com', '+447123456789', '1990-01-01', 'hash1', 'admin', 'email'),
|
||||
('Bob', 'Jones', 'bob@test.com', '+447123456789', '1990-01-01', 'hash2', 'verified_email', 'email'),
|
||||
('Charlie', 'Brown', 'charlie@test.com', '+447123456789', '1990-01-01', 'hash3', 'verified_email', 'email')
|
||||
`)
|
||||
|
||||
+6
-6
@@ -716,24 +716,24 @@ create_guest() {
|
||||
| sed -n 's/.*"id":"\([^"]*\)".*/\1/p'
|
||||
}
|
||||
|
||||
GUEST1_ID=$(create_guest "Alice" "alice.guest@example.com" "+447000000020")
|
||||
GUEST1_ID=$(create_guest "Nina" "nina.guest@example.com" "+447000000020")
|
||||
GUEST2_ID=$(create_guest "Bob" "bob.guest@example.com" "+447000000021")
|
||||
GUEST3_ID=$(create_guest "Carol" "carol.guest@example.com" "+447000000022")
|
||||
# Same email as GUEST1 — should create a separate account (duplicate emails allowed for guests)
|
||||
GUEST4_ID=$(create_guest "Diana" "alice.guest@example.com" "+447000000023")
|
||||
GUEST4_ID=$(create_guest "Diana" "nina.guest@example.com" "+447000000023")
|
||||
# Same email as registered user — should fail (blocked)
|
||||
GUEST5_ID=$(create_guest "Evil" "$USER_EMAIL" "+447000000024")
|
||||
|
||||
count_guest=0
|
||||
|
||||
if [[ -n "$GUEST1_ID" ]]; then
|
||||
echo "${C_GREEN}✅ Created guest: Alice ($GUEST1_ID)${C_RESET}"
|
||||
echo "${C_GREEN}✅ Created guest: Nina ($GUEST1_ID)${C_RESET}"
|
||||
# Book tomorrow at slot B
|
||||
GUEST1_TIME=$(format_london_time "$TOMORROW" "$SLOT_B")
|
||||
GUEST1_JSON="{\"user_id\":\"$GUEST1_ID\",\"start_time\":\"$GUEST1_TIME\",\"service_ids\":[\"$(get_svc 0)\"]}"
|
||||
G1_RESP=$(curl -s -w "\n%{http_code}" -X POST -H 'Content-Type: application/json' -d "$GUEST1_JSON" "$BASE_URL/bookings")
|
||||
G1_CODE=$(echo "$G1_RESP" | tail -n1)
|
||||
if [[ "$G1_CODE" =~ ^2 ]]; then count_guest=$((count_guest+1)); echo "${C_GREEN}✅ Guest booking: Alice - Classic Manicure${C_RESET}"; fi
|
||||
if [[ "$G1_CODE" =~ ^2 ]]; then count_guest=$((count_guest+1)); echo "${C_GREEN}✅ Guest booking: Nina - Classic Manicure${C_RESET}"; fi
|
||||
fi
|
||||
|
||||
if [[ -n "$GUEST2_ID" ]]; then
|
||||
@@ -757,9 +757,9 @@ if [[ -n "$GUEST3_ID" ]]; then
|
||||
fi
|
||||
|
||||
if [[ -n "$GUEST4_ID" && "$GUEST4_ID" != "$GUEST1_ID" ]]; then
|
||||
echo "${C_GREEN}✅ Created guest: Diana ($GUEST4_ID) — shares email with Alice (separate account)${C_RESET}"
|
||||
echo "${C_GREEN}✅ Created guest: Diana ($GUEST4_ID) — shares email with Nina (separate account)${C_RESET}"
|
||||
else
|
||||
echo "${C_YELLOW}⚠️ Diana guest creation — should be separate from Alice${C_RESET}"
|
||||
echo "${C_YELLOW}⚠️ Diana guest creation — should be separate from Nina${C_RESET}"
|
||||
fi
|
||||
|
||||
if [[ -z "$GUEST5_ID" ]]; then
|
||||
|
||||
Reference in New Issue
Block a user