_testSurCategoriesReadAllAs('SUPER'); } private function _testSurCategoriesReadAllAs($role) { //$this->authUser(); $this->authAs($role); $this->get('/sur-categories/index'); $this->get('/sur-categories?sort=nom'); $this->assertResponseOk(); $this->assertResponseContains('Liste des domaines'); $this->assertResponseContains('Electronique'); $this->assertResponseContains('Optique'); } public function testCategoriesReadAllAsSuperAdmin() { $this->_testCategoriesReadAllAs('SUPER'); } private function _testCategoriesReadAllAs($role) { //$this->authUser(); $this->authAs($role); $this->get('/categories/index'); $this->get('/categories?sort=nom'); $this->assertResponseOk(); $this->assertResponseContains('Liste des catégories'); $this->assertResponseContains('Categ1'); $this->assertResponseContains('Electronique'); $this->assertResponseContains('Categ2'); //$this->assertResponseContains('Electronique'); $this->assertResponseContains('Categ3'); $this->assertResponseContains('Optique'); } }