Skip to content

Instantly share code, notes, and snippets.

@uno-de-piera
Last active May 31, 2020 08:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save uno-de-piera/edb756e421ef63dc941ca900ce7f71f7 to your computer and use it in GitHub Desktop.
Save uno-de-piera/edb756e421ef63dc941ca900ce7f71f7 to your computer and use it in GitHub Desktop.
<?php
public function testDatatablesRemoveUser()
{
factory(User::class, 10)->create();
$userToLogin = User::find(2);
$userToRemove = User::find(1);
$this->browse(function (Browser $browser) use($userToLogin, $userToRemove)
{
$browser->loginAs($userToLogin)
->visit('/users/datatables')
->pause(500) //peticiones ajax
->with('.table', function (Browser $table) use ($userToLogin, $userToRemove)
{
$table
->assertSee($userToLogin->email)
->clickLink('Destroy')
->pause(500)
->assertDontSee($userToRemove->email);
});
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment