From 2810c6ec03557a74a619caec69d514428b52f1cd Mon Sep 17 00:00:00 2001 From: Andy Beverley Date: Fri, 20 Oct 2023 15:41:33 +0100 Subject: [PATCH] Fix failing test --- lib/GADS/Schema/ResultSet/User.pm | 3 ++- t/024_user.t | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/GADS/Schema/ResultSet/User.pm b/lib/GADS/Schema/ResultSet/User.pm index ec5f9c4df..f8e3bc277 100644 --- a/lib/GADS/Schema/ResultSet/User.pm +++ b/lib/GADS/Schema/ResultSet/User.pm @@ -57,7 +57,8 @@ sub create_user my $request_base = $params{request_base}; my $user = $self->create({ - username => $params{username}, + email => $params{email}, + username => $params{email}, resetpw => $code, created => DateTime->now, }); diff --git a/t/024_user.t b/t/024_user.t index 977108b50..79fad197f 100644 --- a/t/024_user.t +++ b/t/024_user.t @@ -39,7 +39,7 @@ try { $schema->resultset('User')->create_user(%template, email => $existing) }; like($@, qr/already exists/, "Unable to create user with existing username"); # Same directly in resultset -try { $schema->resultset('User')->create({email => $existing}) }; +try { $schema->resultset('User')->create({email => $existing, username => $existing}) }; like($@, qr/already exists/, "Unable to create user with existing username"); $site->update({ register_organisation_mandatory => 1 });