PostTitleLengthIsLimitedTest.php
709 Bytes
<?php
namespace FootyRoom\Tests;
class PostTitleLengthIsLimitedTest extends TestCase
{
use SetsUpFixtures;
public function testNotAllowedToPostLengthyTitle()
{
$faker = \Faker\Factory::create();
$data = [
'title' => $faker->sentence(50),
'content' => $faker->paragraph().'http://google.com',
'category' => 53,
];
$user = factory('FootyRoom\User\User')->make(['user_id' => 1]);
$response = $this->actingAs($user)->call('POST', '/forum/discussions', $data);
$this->assertEquals(500, $response->status());
$this->assertContains('Post title is limited 120 characters.', $response->getContent());
}
}