remove hack for test
This commit is contained in:
parent
b6cda88ae4
commit
b520a464cb
|
|
@ -69,11 +69,6 @@ class UserController extends Controller
|
||||||
*/
|
*/
|
||||||
public function sign()
|
public function sign()
|
||||||
{
|
{
|
||||||
// Hacking for testing
|
|
||||||
if (config('app.env') == 'testing') {
|
|
||||||
$this->user = User::find($this->user->uid);
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($this->user->canSign()) {
|
if ($this->user->canSign()) {
|
||||||
$acquiredScore = $this->user->sign();
|
$acquiredScore = $this->user->sign();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -88,9 +88,10 @@ class UserControllerTest extends TestCase
|
||||||
)
|
)
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$user->last_sign_at = \Carbon\Carbon::today()->toDateTimeString();
|
$user = factory(User::class)->create([
|
||||||
$user->save();
|
'last_sign_at' => \Carbon\Carbon::today()->toDateTimeString()
|
||||||
$this->postJson('/user/sign')
|
]);
|
||||||
|
$this->actAs($user)->postJson('/user/sign')
|
||||||
->assertJson([
|
->assertJson([
|
||||||
'errno' => 0
|
'errno' => 0
|
||||||
]);
|
]);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user