summaryrefslogtreecommitdiff
path: root/spec/controllers/projects/pipelines_controller_spec.rb
diff options
context:
space:
mode:
authorFilipa Lacerda <filipa@gitlab.com>2017-02-23 13:44:58 +0000
committerFilipa Lacerda <filipa@gitlab.com>2017-02-23 13:44:58 +0000
commit66bca235c1e4e14037100551706abc127b7bb650 (patch)
treed95cb9c1695a2d7a6df164bc97c84f86de0679f5 /spec/controllers/projects/pipelines_controller_spec.rb
parent05c66406ca7e7f29b9b210fda9f31a60528917f1 (diff)
downloadgitlab-ce-66bca235c1e4e14037100551706abc127b7bb650.tar.gz
Adds missing tests for all status accepted in scope
Diffstat (limited to 'spec/controllers/projects/pipelines_controller_spec.rb')
-rw-r--r--spec/controllers/projects/pipelines_controller_spec.rb15
1 files changed, 9 insertions, 6 deletions
diff --git a/spec/controllers/projects/pipelines_controller_spec.rb b/spec/controllers/projects/pipelines_controller_spec.rb
index 242cf18c42b..9a1e79c281a 100644
--- a/spec/controllers/projects/pipelines_controller_spec.rb
+++ b/spec/controllers/projects/pipelines_controller_spec.rb
@@ -12,7 +12,10 @@ describe Projects::PipelinesController do
describe 'GET index.json' do
before do
- create_list(:ci_empty_pipeline, 2, project: project)
+ create(:ci_empty_pipeline, status: 'pending', project: project)
+ create(:ci_empty_pipeline, status: 'running', project: project)
+ create(:ci_empty_pipeline, status: 'created', project: project)
+ create(:ci_empty_pipeline, status: 'success', project: project)
get :index, namespace_id: project.namespace.path,
project_id: project.path,
@@ -23,11 +26,11 @@ describe Projects::PipelinesController do
expect(response).to have_http_status(:ok)
expect(json_response).to include('pipelines')
- expect(json_response['pipelines'].count).to eq 2
- expect(json_response['count']['all']).to eq 2
- expect(json_response['count']['running']).to eq 0
- expect(json_response['count']['pending']).to eq 2
- expect(json_response['count']['finished']).to eq 0
+ expect(json_response['pipelines'].count).to eq 4
+ expect(json_response['count']['all']).to eq 4
+ expect(json_response['count']['running']).to eq 1
+ expect(json_response['count']['pending']).to eq 1
+ expect(json_response['count']['finished']).to eq 1
end
end