Browse Source

Update auth test to use trans helper

pull/1/head
Nafies Luthfi 8 years ago
parent
commit
91d423aca3
  1. 4
      tests/Feature/Auth/MemberChangePasswordTest.php
  2. 2
      tests/Feature/Auth/MemberLoginTest.php
  3. 6
      tests/Feature/Auth/MemberRegistrationTest.php

4
tests/Feature/Auth/MemberChangePasswordTest.php

@ -21,13 +21,13 @@ class MemberChangePasswordTest extends TestCase
$this->type('member1','old_password'); $this->type('member1','old_password');
$this->type('rahasia','password'); $this->type('rahasia','password');
$this->type('rahasia','password_confirmation'); $this->type('rahasia','password_confirmation');
$this->press('Ganti Password');
$this->press(trans('auth.change_password'));
$this->see('Password lama tidak cocok'); $this->see('Password lama tidak cocok');
$this->type('member','old_password'); $this->type('member','old_password');
$this->type('rahasia','password'); $this->type('rahasia','password');
$this->type('rahasia','password_confirmation'); $this->type('rahasia','password_confirmation');
$this->press('Ganti Password');
$this->press(trans('auth.change_password'));
$this->see('Password berhasil diubah'); $this->see('Password berhasil diubah');
// Logout and login using new Password // Logout and login using new Password

2
tests/Feature/Auth/MemberLoginTest.php

@ -19,7 +19,7 @@ class MemberLoginTest extends TestCase
$this->press(trans('auth.login')); $this->press(trans('auth.login'));
$this->seePageIs(route('home')); $this->seePageIs(route('home'));
$this->see('Selamat datang kembali Nama Member.'); $this->see('Selamat datang kembali Nama Member.');
$this->click('Keluar');
$this->click(trans('auth.logout'));
$this->seePageIs(route('auth.login')); $this->seePageIs(route('auth.login'));
$this->see('Anda telah logout.'); $this->see('Anda telah logout.');
} }

6
tests/Feature/Auth/MemberRegistrationTest.php

@ -15,7 +15,7 @@ class MemberRegistrationTest extends TestCase
$this->type('member@app.dev', 'email'); $this->type('member@app.dev', 'email');
$this->type('', 'password'); $this->type('', 'password');
$this->type('', 'password_confirmation'); $this->type('', 'password_confirmation');
$this->press('Buat Akun Baru');
$this->press(trans('auth.register'));
$this->seePageIs(route('auth.register')); $this->seePageIs(route('auth.register'));
$this->see('Nama harus diisi.'); $this->see('Nama harus diisi.');
$this->see('Email ini sudah terdaftar.'); $this->see('Email ini sudah terdaftar.');
@ -26,7 +26,7 @@ class MemberRegistrationTest extends TestCase
$this->type('email', 'email'); $this->type('email', 'email');
$this->type('password', 'password'); $this->type('password', 'password');
$this->type('password..', 'password_confirmation'); $this->type('password..', 'password_confirmation');
$this->press('Buat Akun Baru');
$this->press(trans('auth.register'));
$this->seePageIs(route('auth.register')); $this->seePageIs(route('auth.register'));
$this->see('Email tidak valid.'); $this->see('Email tidak valid.');
$this->see('Konfirmasi password tidak sesuai.'); $this->see('Konfirmasi password tidak sesuai.');
@ -40,7 +40,7 @@ class MemberRegistrationTest extends TestCase
$this->type('email@mail.com', 'email'); $this->type('email@mail.com', 'email');
$this->type('password.111', 'password'); $this->type('password.111', 'password');
$this->type('password.111', 'password_confirmation'); $this->type('password.111', 'password_confirmation');
$this->press('Buat Akun Baru');
$this->press(trans('auth.register'));
$this->seePageIs(route('home')); $this->seePageIs(route('home'));
$this->see('Selamat datang Nama Member.'); $this->see('Selamat datang Nama Member.');
} }

Loading…
Cancel
Save