Add HTTP/feature test for updating tags
MODIFY
tests/Feature/TagTest.php
tests/Feature/TagTest.php
@@ -10,6 +10,7 @@ use Illuminate\Foundation\Testing\WithFaker;
use Illuminate\Foundation\Testing\RefreshDatabase;
class TagTest extends TestCase {
+ // Edit
public function testAuthorizedUserCanEditTag() {
$user = factory(User::class)->create();
@@ -43,4 +44,26 @@ class TagTest extends TestCase {
$response->assertStatus(403);
}
+
+ // Update
+ public function testUpdateTag() {
+ $user = factory(User::class)->create();
+
+ $space = factory(Space::class)->create();
+
+ $user->spaces()->sync([$space->id]);
+
+ $tag = factory(Tag::class)->create([
+ 'space_id' => $space->id,
+ 'name' => 'Before'
+ ]);
+
+ $this->actingAs($user);
+
+ $this->patch('/tags/' . $tag->id, [
+ 'name' => 'After'
+ ]);
+
+ $this->assertEquals(Tag::find($tag->id)->name,'After');
+ }
}

Add HTTP/feature test for updating tags