/** * @test */ public function it_allows_send_a_contact_message() { MailThief::hijack(); Honeypot::disable(); $this->visit(route('contact.show'))->type('John Doe', 'name')->type('*****@*****.**', 'email')->type('Contract', 'subject')->type('PHP Interfaces are important.', 'text')->press('Send')->see(trans('contact::contact.send_successfully')); $this->assertTrue(MailThief::hasMessageFor('*****@*****.**')); $this->assertEquals('Contract', MailThief::lastMessage()->subject); $this->assertEquals('*****@*****.**', MailThief::lastMessage()->data['email']); }
/** * @test */ public function it_not_allow_to_login_without_verify() { // register a user Honeypot::disable(); $formUser = $this->registerUser(); // login $this->visit('/login')->type($formUser->email, 'email')->type($formUser->password, 'password')->press(trans('user::user.login'))->see('alert-danger'); $this->assertTrue(Auth::guest(), 'User is logged in'); }
/** * @test */ public function it_allows_to_register_user() { Honeypot::disable(); $user = factory(User::class, 'form')->make(); $this->visit('/register')->see('Register')->type($user->username, 'username')->type($user->email, 'email')->type($user->password, 'password')->type($user->password, 'password_confirmation')->press(trans('user::user.register'))->see('alert-success'); }