-
-
Notifications
You must be signed in to change notification settings - Fork 199
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Load metrics for job statuses asynchronously (#1286)
* Load metrics for job statuses asynchronously * Extract state names to method; add basic request tests --------- Co-authored-by: Ben Sheldon [he/him] <[email protected]>
- Loading branch information
1 parent
35461ea
commit 20fd1f8
Showing
7 changed files
with
66 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# frozen_string_literal: true | ||
|
||
require 'rails_helper' | ||
|
||
describe GoodJob::MetricsController do | ||
describe 'GET #primary_nav' do | ||
it 'returns the primary navigation metrics' do | ||
get good_job.metrics_primary_nav_path | ||
expect(response).to have_http_status(:ok) | ||
expect(response.body).to eq( | ||
{ | ||
jobs_count: '0', | ||
batches_count: '0', | ||
cron_entries_count: '1', | ||
processes_count: '0', | ||
}.to_json | ||
) | ||
end | ||
end | ||
|
||
describe 'GET #job_status' do | ||
it 'returns the primary navigation metrics' do | ||
get good_job.metrics_job_status_path | ||
expect(response).to have_http_status(:ok) | ||
expect(response.body).to eq( | ||
{ | ||
"scheduled" => "0", | ||
"retried" => "0", | ||
"queued" => "0", | ||
"running" => "0", | ||
"succeeded" => "0", | ||
"discarded" => "0", | ||
}.to_json | ||
) | ||
end | ||
end | ||
end |