FlagOnUnApprovedCommentTest.php 521 Bytes
<?php

namespace FootyRoom\Tests;

class FlagOnUnApprovedCommentTest extends TestCase
{
    use SetsUpFixtures;

    public function testFlagOnUnApprovedCommentIsNotAllowed()
    {
        $user = factory('FootyRoom\User\User')->make(['user_id' => 2]);
        $response = $this->actingAs($user)->json('POST', '/comments/2/flag', ['flagName' => 'rude']);
        $this->assertEquals(400, $response->status());
        $this->assertContains('The comment you are trying to flag is gone.', $response->getContent());
    }
}