mirror of
				https://github.com/invoiceninja/invoiceninja.git
				synced 2025-10-31 12:27:31 -04:00 
			
		
		
		
	* Tests for authentication * Add db field to company table (required if we are doing jobs without an auth()->user() ) * Add Laravel Dusk for browser testing, add ability to set DB by incoming URL Hash
		
			
				
	
	
		
			57 lines
		
	
	
		
			1.4 KiB
		
	
	
	
		
			PHP
		
	
	
	
	
	
			
		
		
	
	
			57 lines
		
	
	
		
			1.4 KiB
		
	
	
	
		
			PHP
		
	
	
	
	
	
| <?php
 | |
| 
 | |
| namespace Tests\Browser;
 | |
| 
 | |
| use Illuminate\Foundation\Testing\DatabaseTransactions;
 | |
| use Tests\DuskTestCase;
 | |
| use Illuminate\Foundation\Testing\WithFaker;
 | |
| use Illuminate\Foundation\Testing\WithoutMiddleware;
 | |
| 
 | |
| 
 | |
| 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()
 | |
|     {
 | |
|         /*
 | |
|         $response = $this->post('/signup', [
 | |
|             'first_name' => $this->faker->firstName(),
 | |
|             'last_name' => $this->faker->lastName(),
 | |
|             'terms_of_service' => 1,
 | |
|             'privacy_policy' => 1,
 | |
|             'email' => config('ninja.testvars.username'),
 | |
|             'password' => config('ninja.testvars.password')
 | |
|         ]);
 | |
| 
 | |
| 
 | |
|         $response->assertSuccessful();
 | |
|         */
 | |
| 
 | |
|         $this->visit('/signup')
 | |
|             ->type($this->faker->firstName(), 'first_name')
 | |
|             ->type($this->faker->lastName(), 'last_name')
 | |
|             ->type($this->faker->email(), 'email')
 | |
|             ->type($this->faker->password(7), 'password')
 | |
|             ->check('terms_of_service')
 | |
|             ->check('terms_of_service')
 | |
|             ->press(trans('texts.create_account'))
 | |
|             ->seePageIs('/dashboard');
 | |
| 
 | |
|     }
 | |
| 
 | |
| }
 |