ViewMatchTest.php 857 Bytes
<?php

namespace FootyRoom\Tests;

class ViewMatchTest extends TestCase
{
    use SetsUpFixtures;

    public function testCanViewExistingMatch()
    {
        $response = $this->call('GET', 'http://'.app('FootyRoom\Config')->get('domain').'/matches/1957/manchester-city-vs-everton/review');
        $this->assertEquals(200, $response->status());
    }

    public function testRedirectToCorrectUrl()
    {
        $response = $this->call('GET', '/matches/1957/-/review');
        $this->assertEquals(301, $response->status());
        $response->assertLocation('http://'.app('FootyRoom\Config')->get('domain').'/matches/1957/manchester-city-vs-everton/review');
    }

    public function testViewMatchNotFoundThrow404()
    {
        $response = $this->call('GET', '/matches/9999/-/review');
        $this->assertEquals(404, $response->status());
    }
}