public function it_returns_json_permissions_list_for_action_role_permission_on_successful_request(FunctionalTester $I)
 {
     $user = $this->userActor->makeLoggedUser($I);
     $user->setRole('admin');
     $user->attachPermission('updateUsersAccess');
     $I->sendAjaxGetRequest($this->ajaxUrl, ['action' => 'role_permissions', 'role_id' => 1]);
     $I->seeResponseCodeIs(200);
 }
 public function it_logs_out_successfully(FunctionalTester $I)
 {
     $this->userActor->makeLoggedUser($I);
     $I->seeAuthentication();
     $I->amOnRoute('auth.logout');
     $I->dontSeeAuthentication();
     $I->seeCurrentRouteIs('home');
 }
 public function it_has_permission_in_db_after_registration(FunctionalTester $I)
 {
     $I->amOnRoute(RegisterPage::$ROUTE);
     $userData = $this->userActor->fillRegisterPageFields($I);
     $I->submitForm(RegisterPage::$formId, [], 'Register');
     $user = $I->grabRecord('users', ['username' => $userData['username']]);
     $permission = Permission::where('name', '=', array_shift(Permission::$defaultPermissions))->first();
     $I->seeRecord(UserPermission::$tableName, ['user_id' => $user->id, 'permission_id' => $permission->id]);
 }
 public function it_allows_users_to_edit_their_profiles(AcceptanceTester $I)
 {
     $user = $this->userActor->makeLoggedUser($I);
     $profilePage = new ProfilePage($I);
     $I->amOnRoute('profile.edit', $user->username);
     $I->seeInCurrentUrl('profile/' . $user->username);
     $I->seeCurrentRouteIs('profile.edit', $user->username);
     $profilePage->validateForm();
 }
 public function it_successfully_updates_user_password(FunctionalTester $I)
 {
     $password = '******';
     $logged = $this->userActor->makeLoggedUser($I);
     $I->amOnRoute('profile.edit', $logged->username);
     $I->fillField('password', $password);
     $I->fillField('password_confirmation', $password);
     $I->submitForm(ProfilePage::$formId, [], 'Update');
     $I->see('Profile successfully updated!');
 }
 public function it_logs_out_successfully(AcceptanceTester $I)
 {
     $user = $this->userActor->makeLoggedUser($I);
     $I->click('Logout');
     $I->see('Login');
     $I->see('Register');
     $I->dontSee($user->username);
     $I->dontSee('View profile');
     $I->dontSee('Edit profile');
     $I->dontSee('Logout');
 }
 public function it_does_nothing_when_detaching_not_assigned_permission(FunctionalTester $I)
 {
     $user = $this->userActor->create();
     $user->detachPermission('accessDashboard');
 }
예제 #8
0
<?php

use Faker\Factory as Faker;
use Actors\UserActor;
/**
 * @var $factory
 * @var $faker
 */
$actor = new UserActor();
$factory('App\\Clusters\\AuthCluster\\Models\\User', $actor->makeUserData());