Test authorized user's access to editing of tags
MODIFY
tests/Feature/TagTest.php
tests/Feature/TagTest.php
@@ -10,6 +10,24 @@ use Illuminate\Foundation\Testing\WithFaker;
use Illuminate\Foundation\Testing\RefreshDatabase;
class TagTest extends TestCase {
+ public function testAuthorizedUserCanEditTag() {
+ $user = factory(User::class)->create();
+
+ $space = factory(Space::class)->create();
+
+ $user->spaces()->sync([$space->id]);
+
+ $tag = factory(Tag::class)->create([
+ 'space_id' => $space->id
+ ]);
+
+ $this->actingAs($user);
+
+ $response = $this->get('/tags/' . $tag->id . '/edit');
+
+ $response->assertStatus(200);
+ }
+
public function testUnauthorizedUserCantEditTag() {
$user = factory(User::class)->create();

Test authorized user's access to editing of tags