From 59054be56ec33d9e26f8ba890b6221c628880e51 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Batuhan=20Ba=C5=9F?= Date: Fri, 19 Oct 2018 14:39:36 +0300 Subject: [PATCH] Get automatically some permissions for Role Test --- tests/Feature/Auth/RolesTest.php | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/tests/Feature/Auth/RolesTest.php b/tests/Feature/Auth/RolesTest.php index 7f688429e..d48e85b7d 100644 --- a/tests/Feature/Auth/RolesTest.php +++ b/tests/Feature/Auth/RolesTest.php @@ -27,11 +27,8 @@ class RolesTest extends FeatureTestCase public function testItShouldCreateRole() { - $r = route('roles.store'); - $rr = $this->getRoleRequest(); - $this->loginAs() - ->post($r, $rr) + ->post(route('roles.store'), $this->getRoleRequest()) ->assertStatus(302) ->assertRedirect(route('roles.index')); @@ -78,13 +75,11 @@ class RolesTest extends FeatureTestCase private function getRoleRequest() { - $permissions = array(0=>'93', 1=>'94', 2=>'95', 3=>'97', 4=>'99', 5=>'100', 6=>'96', 7=>'98', 8=>'101'); - return [ 'name' => $this->faker->text(5), 'display_name' => $this->faker->text(5), 'description' => $this->faker->text(5), - 'permissions' => $permissions, + 'permissions' => Permission::take(10)->pluck('id')->toArray(), ]; } } \ No newline at end of file