Skip to content

Commit

Permalink
fix test + added one for new status check
Browse files Browse the repository at this point in the history
  • Loading branch information
glamorous committed Nov 20, 2020
1 parent dd7388c commit 21999ca
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion tests/Controller/DashboardStatsControllerTest.php
Expand Up @@ -74,7 +74,7 @@ public function test_paused_status_is_reflected_if_all_master_supervisors_are_pa
$masters = Mockery::mock(MasterSupervisorRepository::class);
$masters->shouldReceive('all')->andReturn([
(object) [
'status' => 'running',
'status' => 'paused',
],
(object) [
'status' => 'paused',
Expand All @@ -89,4 +89,25 @@ public function test_paused_status_is_reflected_if_all_master_supervisors_are_pa
'status' => 'paused',
]);
}

public function test_paused_status_isnt_reflected_if_not_all_master_supervisors_are_paused()
{
$masters = Mockery::mock(MasterSupervisorRepository::class);
$masters->shouldReceive('all')->andReturn([
(object) [
'status' => 'running',
],
(object) [
'status' => 'paused',
],
]);
$this->app->instance(MasterSupervisorRepository::class, $masters);

$response = $this->actingAs(new Fakes\User)
->get('/horizon/api/stats');

$response->assertJson([
'status' => 'running',
]);
}
}

0 comments on commit 21999ca

Please sign in to comment.