1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-09-22 09:21:34 +02:00
invoiceninja/tests/Browser/CreateAccountTest.php
David Bomba 849f6e5439
Fixes for Tests, implement MakeHash trait (#2469)
* Fixes for Feature and browser tests

* Change .env.example variable names, implement hash encoding of db numbers for URIs
2018-10-26 15:53:29 +11:00

48 lines
1.2 KiB
PHP

<?php
namespace Tests\Browser;
use Illuminate\Foundation\Testing\DatabaseTransactions;
use Illuminate\Support\Facades\DB;
use Tests\DuskTestCase;
use Illuminate\Foundation\Testing\WithFaker;
use Laravel\Dusk\Browser;
class CreateAccountTest extends DuskTestCase
{
use WithFaker;
use DatabaseTransactions;
public function testSignupFormDisplayed()
{
$response = $this->get('/signup');
$response->assertStatus(200);
}
/**
* A valid user can be logged in.
*
* @return void
*/
public function testCreateAValidUser()
{
DB::beginTransaction();
$this->browse(function (Browser $browser) {
$browser->visit('/signup')
->type('first_name',$this->faker->firstName())
->type('last_name', $this->faker->lastName())
->type('email', $this->faker->email())
->type('password', $this->faker->password(7))
->check('terms_of_service')
->check('privacy_policy')
->press(trans('texts.create_account'))
->assertPathIs('/dashboard');
});
DB::rollback();
}
}