Commit c5cfbb50 authored by Jacob Priddy's avatar Jacob Priddy 👌
Browse files

FIx issues with setting the timezone

parent 9a893292
Pipeline #8939 passed with stages
in 4 minutes and 45 seconds
......@@ -74,7 +74,7 @@ class Handler extends ExceptionHandler
/** @var StatusResponseUseCase $useCase */
$useCase = app()->make(StatusResponseUseCase::class);
$useCase->getStatusForDoor($doorGuard->id(), Carbon::now(), Carbon::now()->addMinutes(config('app.status_foresight')), $presenter);
return new JsonResponse($presenter->getViewModel(), 401);
return new JsonResponse($presenter->getViewModel(), 403);
}
return response()->json(['message' => $e->getMessage()], 403);
......
......@@ -43,7 +43,7 @@ class DoorAccessTest extends AuthenticatesWithApplicationTestCase
* @test
* @throws \Source\Exceptions\EntityExistsException
*/
public function it_denies_unauthorized_users(): void
public function it_denies_unauthorized_doors(): void
{
$this->authenticateAsDoor();
......@@ -56,7 +56,7 @@ class DoorAccessTest extends AuthenticatesWithApplicationTestCase
* @test
* @throws \Source\Exceptions\EntityExistsException
*/
public function it_allows_valid_users(): void
public function it_allows_valid_doors(): void
{
// Just add an open mode schedule, we test the actual auth logic elsewhere.
// Here we are testing integration with the route
......
......@@ -63,9 +63,9 @@ class PresenterTest extends TestCase
'id' => 69,
'location' => 'location',
'name' => 'nameeee yee haw',
'created_at' => '2020-03-11T00:49:25+00:00',
'updated_at' => '2020-03-11T00:49:29+00:00',
'last_seen_at' => '2020-04-10T18:49:00+00:00',
'created_at' => '2020-03-11T00:49:25-07:00',
'updated_at' => '2020-03-11T00:49:29-07:00',
'last_seen_at' => '2020-04-10T18:49:00-07:00',
], $this->response['door']);
}
}
......@@ -45,7 +45,7 @@ class PresenterTest extends TestCase
'id' => 0,
'title' => 'title',
'description' => 'desc',
'created_at' => '2020-03-01T23:14:45+00:00',
'created_at' => '2020-03-01T23:14:45-08:00',
'updated_at' => null,
],
], $this->response);
......
......@@ -66,7 +66,7 @@ class PresenterTest extends TestCase
'id' => 0,
'title' => 'title',
'description' => 'desc',
'created_at' => '2020-02-02T20:50:49+00:00',
'created_at' => '2020-02-02T20:50:49-08:00',
'updated_at' => null,
],
],
......
......@@ -51,7 +51,7 @@ class PresenterTest extends TestCase
'id' => 0,
'title' => 'title',
'description' => 'desc',
'created_at' => '2020-03-02T00:17:55+00:00',
'created_at' => '2020-03-02T00:17:55-08:00',
'updated_at' => null,
],
],
......
......@@ -53,7 +53,7 @@ class PresenterTest extends TestCase
'id' => 0,
'title' => 'title',
'description' => 'desc',
'created_at' => '2020-03-02T00:40:30+00:00',
'created_at' => '2020-03-02T00:40:30-08:00',
'updated_at' => null,
],
], $this->response);
......
......@@ -83,7 +83,7 @@ class PresenterTest extends TestCase
$this->assertEquals([
'value' => 'token',
'expires_at' => '2020-03-04T00:00:00+00:00',
'expires_at' => '2020-03-04T00:00:00-08:00',
'minutes' => $minutes,
], $this->response['token']);
}
......@@ -123,7 +123,7 @@ class PresenterTest extends TestCase
'display_name' => 'display',
'emplid' => 'emplid',
'email' => 'email',
'expires_at' => '2020-02-02T00:00:00+00:00',
'expires_at' => '2020-02-02T00:00:00-08:00',
'created_at' => null,
'updated_at' => null,
], $this->response['user']);
......
......@@ -62,7 +62,7 @@ class PresenterTest extends TestCase
'display_name' => 'display',
'emplid' => 'emplid',
'email' => 'email',
'expires_at' => '2020-02-02T00:00:00+00:00',
'expires_at' => '2020-02-02T00:00:00-08:00',
'created_at' => null,
'updated_at' => null,
],
......
......@@ -71,7 +71,7 @@ class PresenterTest extends TestCase
'display_name' => 'display',
'emplid' => 'emplid',
'email' => 'email',
'expires_at' => '2020-02-02T00:00:00+00:00',
'expires_at' => '2020-02-02T00:00:00-08:00',
'created_at' => null,
'updated_at' => null,
],
......
......@@ -63,7 +63,7 @@ class PresenterTest extends TestCase
'display_name' => 'display',
'emplid' => 'emplid',
'email' => 'email',
'expires_at' => '2020-02-02T00:00:00+00:00',
'expires_at' => '2020-02-02T00:00:00-08:00',
'created_at' => null,
'updated_at' => null,
],
......
......@@ -180,7 +180,7 @@ class UseCaseTest extends TestCase
$this->handleTest('69', $this->createUserAttributes($updatedUser));
$this->assertEquals('2020-03-07T20:58:50+00:00', $this->response->getUser()->getExpiresAt()->format('c'));
$this->assertEquals('2020-03-07T20:58:50-08:00', $this->response->getUser()->getExpiresAt()->format('c'));
}
/**
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment