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; ...@@ -5,12 +5,17 @@ use Illuminate\Support\Facades\Config;
class UrlTest extends \TestCase class UrlTest extends \TestCase
{ {
/** @test */ public function setUp()
public function userIndexShouldBeAccessible()
{ {
parent::setUp();
$user = Sentinel::findById(4); $user = Sentinel::findById(4);
Sentinel::login($user); Sentinel::login($user);
}
/** @test */
public function userIndexShouldBeAccessible()
{
$uri = '/' . Config::get('core::core.admin-prefix') . '/users'; $uri = '/' . Config::get('core::core.admin-prefix') . '/users';
$crawler = $this->client->request('GET', $uri); $crawler = $this->client->request('GET', $uri);
...@@ -18,4 +23,16 @@ class UrlTest extends \TestCase ...@@ -18,4 +23,16 @@ class UrlTest extends \TestCase
$this->assertCount(1, $crawler->filter('h1:contains("Users")')); $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