Attendize/tests/UserTest.php

44 lines
1.1 KiB
PHP
Raw Normal View History

2016-04-27 23:15:49 +00:00
<?php
use Illuminate\Foundation\Testing\WithoutMiddleware;
use Illuminate\Foundation\Testing\DatabaseMigrations;
use Illuminate\Foundation\Testing\DatabaseTransactions;
2016-06-16 02:09:54 +00:00
use App\Attendize\Utils;
2016-04-27 23:15:49 +00:00
class UserTest extends TestCase
{
/**
2016-06-16 01:36:09 +00:00
* Test sign up page is successful
2016-04-27 23:15:49 +00:00
*
* @return void
*/
public function testSignup()
{
$this->visit(route('showSignup'))
->type('Joe', 'first_name')
->type('Blogs', 'last_name')
->type($this->faker->email, 'email')
->type('password', 'password')
2016-06-16 02:09:54 +00:00
->type('password', 'password_confirmation');
// Add checkbox submission for attendize (dev/cloud) only
if (Utils::isAttendize()) {
$this->check('terms_agreed');
}
$this->press('Sign Up')
2016-04-27 23:15:49 +00:00
->seePageIs(route('login'));
}
2016-06-16 01:36:09 +00:00
2016-04-27 23:15:49 +00:00
public function testLogin()
{
$this->visit(route('login'))
->type($this->test_user_email, 'email')
->type($this->test_user_password, 'password')
->press('Login')
->seePageIs(route('showCreateOrganiser', ['first_run' => '1']));
}
}