From 481217425bdb55effdcdf7f7d59e37689dfa7f9e Mon Sep 17 00:00:00 2001 From: "Emma C. Hughes" <84008144+emmachughes@users.noreply.github.com> Date: Mon, 13 Nov 2023 13:55:19 +0100 Subject: [PATCH] fix mistake & test --- sourcecode/hub/app/Providers/AuthServiceProvider.php | 2 +- sourcecode/hub/tests/Feature/UserTest.php | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/sourcecode/hub/app/Providers/AuthServiceProvider.php b/sourcecode/hub/app/Providers/AuthServiceProvider.php index 6456bb1e37..d06696e6f1 100644 --- a/sourcecode/hub/app/Providers/AuthServiceProvider.php +++ b/sourcecode/hub/app/Providers/AuthServiceProvider.php @@ -58,7 +58,7 @@ public function boot(): void Gate::define('reset-password', function (User|null $user) { $features = app()->make(Features::class); - return $features->isSignupEnabled(); + return $features->isForgotPasswordEnabled(); }); } } diff --git a/sourcecode/hub/tests/Feature/UserTest.php b/sourcecode/hub/tests/Feature/UserTest.php index 1ced3b28d2..a83994379a 100644 --- a/sourcecode/hub/tests/Feature/UserTest.php +++ b/sourcecode/hub/tests/Feature/UserTest.php @@ -24,9 +24,9 @@ public function testSignupsAreUsuallyEnabled(): void public function testSignupCanBeDisabled(): void { - config(['features.sign-up' => false]); + config()->set('features.sign-up', false); - $this->get('/register')->assertNotFound(); + $this->get('/register')->assertForbidden(); } public function testForgotPasswordIsUsuallyEnabled(): void @@ -36,9 +36,9 @@ public function testForgotPasswordIsUsuallyEnabled(): void public function testForgotPasswordCanBeDisabled(): void { - config(['features.forgot-password' => false]); + config()->set('features.forgot-password', false); - $this->get('/forgot-password')->assertNotFound(); + $this->get('/forgot-password')->assertForbidden(); } public function testSerialisation(): void