summaryrefslogtreecommitdiff
path: root/spec/requests/api/ci/pipelines_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/requests/api/ci/pipelines_spec.rb')
-rw-r--r--spec/requests/api/ci/pipelines_spec.rb19
1 files changed, 19 insertions, 0 deletions
diff --git a/spec/requests/api/ci/pipelines_spec.rb b/spec/requests/api/ci/pipelines_spec.rb
index d0c2b383013..092cd00630e 100644
--- a/spec/requests/api/ci/pipelines_spec.rb
+++ b/spec/requests/api/ci/pipelines_spec.rb
@@ -362,6 +362,25 @@ RSpec.describe API::Ci::Pipelines do
it do
expect(response).to have_gitlab_http_status(:ok)
expect(json_response).to be_an Array
+
+ expect(json_response).to all match a_hash_including(
+ 'duration' => be_nil,
+ 'queued_duration' => (be >= 0.0)
+ )
+ end
+ end
+
+ context 'when filtering to only running jobs' do
+ let(:query) { { 'scope' => 'running' } }
+
+ it do
+ expect(response).to have_gitlab_http_status(:ok)
+ expect(json_response).to be_an Array
+
+ expect(json_response).to all match a_hash_including(
+ 'duration' => (be >= 0.0),
+ 'queued_duration' => (be >= 0.0)
+ )
end
end