Commit a87b5830 authored by Nicolas Widart's avatar Nicolas Widart

Add test to secure the create and edit views

parent 48b02cd4
......@@ -5,12 +5,17 @@ use Illuminate\Support\Facades\Config;
class UrlTest extends \TestCase
{
/** @test */
public function userIndexShouldBeAccessible()
public function setUp()
{
parent::setUp();
$user = Sentinel::findById(4);
Sentinel::login($user);
}
/** @test */
public function userIndexShouldBeAccessible()
{
$uri = '/' . Config::get('core::core.admin-prefix') . '/users';
$crawler = $this->client->request('GET', $uri);
......@@ -18,4 +23,16 @@ class UrlTest extends \TestCase
$this->assertCount(1, $crawler->filter('h1:contains("Users")'));
}
/** @test */
public function userEditShouldBeAccessible()
{
$uri = '/' . Config::get('core::core.admin-prefix') . '/users/4/edit';
$crawler = $this->client->request('GET', $uri);
$this->assertTrue($this->client->getResponse()->isOk());
$this->assertCount(1, $crawler->filter('h1:contains("Edit User")'));
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment