diff options
author | Patricio Cano <suprnova32@gmail.com> | 2016-06-15 02:38:54 +0300 |
---|---|---|
committer | Patricio Cano <suprnova32@gmail.com> | 2016-06-17 19:16:25 +0300 |
commit | 8ad1884505e1b155b80c2613ecfdb5f93e70b80d (patch) | |
tree | c62a62eaf87f358c39a34bd689309b8ab87c2f63 /spec/requests | |
parent | 9c87eeb3a05c6d2afb1b47f91549d3be16a74d50 (diff) |
Fixed Rubocop error
Diffstat (limited to 'spec/requests')
-rw-r--r-- | spec/requests/api/sidekiq_metrics_spec.rb | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/spec/requests/api/sidekiq_metrics_spec.rb b/spec/requests/api/sidekiq_metrics_spec.rb new file mode 100644 index 00000000000..41cbf0c6669 --- /dev/null +++ b/spec/requests/api/sidekiq_metrics_spec.rb @@ -0,0 +1,40 @@ +require 'spec_helper' + +describe API::SidekiqMetrics, api: true do + include ApiHelpers + + let(:admin) { create(:user, :admin) } + + describe 'GET sidekiq/*' do + it 'defines the `queue_metrics` endpoint' do + get api('/sidekiq/queue_metrics', admin) + + expect(response.status).to eq(200) + expect(json_response).to be_a Hash + end + + it 'defines the `process_metrics` endpoint' do + get api('/sidekiq/process_metrics', admin) + + expect(response.status).to eq(200) + expect(json_response['processes']).to be_an Array + end + + it 'defines the `job_stats` endpoint' do + get api('/sidekiq/job_stats', admin) + + expect(response.status).to eq(200) + expect(json_response).to be_a Hash + end + + it 'defines the `compound_metrics` endpoint' do + get api('/sidekiq/compound_metrics', admin) + + expect(response.status).to eq(200) + expect(json_response).to be_a Hash + expect(json_response['queues']).to be_a Hash + expect(json_response['processes']).to be_an Array + expect(json_response['jobs']).to be_a Hash + end + end +end |