From dde718e27f7fb6495df9d6e2ad68c71a31d8ddf4 Mon Sep 17 00:00:00 2001 From: Alexander Skvortsov Date: Thu, 19 Nov 2020 15:35:03 -0500 Subject: [PATCH] Fix user ShowTests --- tests/integration/api/users/ShowTest.php | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/tests/integration/api/users/ShowTest.php b/tests/integration/api/users/ShowTest.php index afaff63d5..3ee210203 100644 --- a/tests/integration/api/users/ShowTest.php +++ b/tests/integration/api/users/ShowTest.php @@ -158,7 +158,11 @@ class ShowTest extends TestCase */ public function user_can_see_others_if_allowed() { - $this-> + $this->prepareDatabase([ + 'group_permission' => [ + ['permission' => 'viewDiscussions', 'group_id' => 3], + ] + ]); $response = $this->send( $this->request('GET', '/api/users/1', [ @@ -166,7 +170,7 @@ class ShowTest extends TestCase ]) ); - $this->assertEquals(404, $response->getStatusCode()); + $this->assertEquals(200, $response->getStatusCode()); } /** @@ -174,6 +178,12 @@ class ShowTest extends TestCase */ public function user_can_see_others_if_allowed_via_slug() { + $this->prepareDatabase([ + 'group_permission' => [ + ['permission' => 'viewDiscussions', 'group_id' => 3], + ] + ]); + $response = $this->send( $this->request('GET', '/api/users/admin', [ 'authenticatedAs' => 2, @@ -182,6 +192,6 @@ class ShowTest extends TestCase ]) ); - $this->assertEquals(404, $response->getStatusCode()); + $this->assertEquals(200, $response->getStatusCode()); } }