Skip to content

Commit

Permalink
test: Update expected test results after latest merge
Browse files Browse the repository at this point in the history
  • Loading branch information
hangy committed Oct 6, 2024
1 parent 5ed1e6f commit 3c3f633
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 35 deletions.
6 changes: 6 additions & 0 deletions lib/ProductOpener/Users.pm
Original file line number Diff line number Diff line change
Expand Up @@ -665,6 +665,12 @@ sub process_user_form ($type, $user_ref, $request_ref) {
# save user
store_user($user_ref);

# Initialize the session to send a session cookie back
# so that newly created users do not have to login right after

param("user_id", $userid);
init_user($request_ref);

return;
}

Expand Down
2 changes: 1 addition & 1 deletion tests/integration/create_pro_user.t
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ my @mails = mails_from_log($logs);
# get text
@mails = map {; normalize_mail_for_comparison($_)} @mails;
# we got three
is(scalar @mails, 3, "3 mails sent on subscription");
is(scalar @mails, 1, "1 mails sent on subscription");
# compare
compare_to_expected_results(\@mails, "$expected_result_dir/mails.json",
$update_expected_results, {desc => "mail sent after subscription"});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"errors" : [
{
"field" : {
"error" : "'null' expected, at character offset 0 (before \"not json\") at /opt/product-opener/lib/ProductOpener/API.pm line 226.\n",
"error" : "'null' expected, at character offset 0 (before \"not json\") at /opt/product-opener/lib/ProductOpener/API.pm line 230.\n",
"id" : "body",
"value" : "not json"
},
Expand Down
33 changes: 0 additions & 33 deletions tests/integration/expected_test_results/create_pro_user/mails.json
Original file line number Diff line number Diff line change
Expand Up @@ -142,38 +142,5 @@
"",
"",
"--boundary--"
],
[
"Date: ***",
"MIME-Version: 1.0",
"Content-Type: text/html; charset=utf-8",
"Content-Transfer-Encoding: quoted-printable",
"From: \"Open Food Facts\" <contact@openfoodfacts.org>",
"To: Test <test@test.com>",
"Subject: Thanks for joining Open Food Facts",
"",
"<html><body><p>Welcome Test, your user ID: <b>tests</b></p></body></html>"
],
[
"Date: ***",
"MIME-Version: 1.0",
"Content-Type: text/plain; charset=utf-8",
"Content-Transfer-Encoding: quoted-printable",
"From: \"Open Food Facts\" <contact@openfoodfacts.org>",
"To: \"Open Food Facts\" <stephane@openfoodfacts.org>",
"Subject: Inscription de tests",
"",
"",
"Bonjour,",
"",
"Inscription d'un utilisateur :",
"",
"name: Test",
"email: test@test.com",
"twitter: https://twitter.com/",
"newsletter:=20",
"discussion:=20",
"lc: en",
"cc: world"
]
]

0 comments on commit 3c3f633

Please sign in to comment.