summaryrefslogtreecommitdiff
path: root/spec/controllers/projects/pipelines_controller_spec.rb
diff options
context:
space:
mode:
authorShinya Maeda <gitlab.shinyamaeda@gmail.com>2017-03-06 21:01:18 +0900
committerShinya Maeda <gitlab.shinyamaeda@gmail.com>2017-03-23 17:11:48 +0900
commit4fa4a2ce999c75aee1261815656e47f66d73c725 (patch)
tree745f261cf88d5b01437e66275a31c047826e3688 /spec/controllers/projects/pipelines_controller_spec.rb
parentaf86d33653790d328a13cef65883cd820aae6209 (diff)
downloadgitlab-ce-4fa4a2ce999c75aee1261815656e47f66d73c725.tar.gz
Add controllers spec
Diffstat (limited to 'spec/controllers/projects/pipelines_controller_spec.rb')
-rw-r--r--spec/controllers/projects/pipelines_controller_spec.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/spec/controllers/projects/pipelines_controller_spec.rb b/spec/controllers/projects/pipelines_controller_spec.rb
index 04bb5cbbd59..b8ab9933f33 100644
--- a/spec/controllers/projects/pipelines_controller_spec.rb
+++ b/spec/controllers/projects/pipelines_controller_spec.rb
@@ -69,4 +69,21 @@ describe Projects::PipelinesController do
format: :json
end
end
+
+ describe 'GET status.json' do
+ context 'when accessing status' do
+ before do
+ pipeline = create(:ci_pipeline, project: project, status: 'success')
+ get :status, namespace_id: project.namespace,
+ project_id: project,
+ id: pipeline.id,
+ format: :json
+ end
+
+ it 'returns pipeline status via PipelineSerializer' do
+ expect(response).to have_http_status(:ok)
+ expect(json_response['details']['status']['text']).to eq 'passed'
+ end
+ end
+ end
end