diff options
author | Kamil Trzcinski <ayufan@ayufan.eu> | 2017-06-07 12:32:16 +0200 |
---|---|---|
committer | Kamil Trzcinski <ayufan@ayufan.eu> | 2017-06-13 16:05:38 +0200 |
commit | 25b99a5b3beecb7251fef9097c44afd1f82f9f57 (patch) | |
tree | 8f005048ec11ae7ad27e5d999b263b458c7487a8 /spec/serializers | |
parent | d03e687882552cedaac2a493c9dbf4a3d98e0bac (diff) | |
download | gitlab-ce-25b99a5b3beecb7251fef9097c44afd1f82f9f57.tar.gz |
Update tests and applicationfix-external-ci-services
Diffstat (limited to 'spec/serializers')
-rw-r--r-- | spec/serializers/job_entity_spec.rb | 4 | ||||
-rw-r--r-- | spec/serializers/pipeline_details_entity_spec.rb | 14 | ||||
-rw-r--r-- | spec/serializers/stage_entity_spec.rb | 11 |
3 files changed, 27 insertions, 2 deletions
diff --git a/spec/serializers/job_entity_spec.rb b/spec/serializers/job_entity_spec.rb index 6a694576b4a..5ca7bf2fcaf 100644 --- a/spec/serializers/job_entity_spec.rb +++ b/spec/serializers/job_entity_spec.rb @@ -39,7 +39,7 @@ describe JobEntity do expect(subject[:status]).to include :icon, :favicon, :text, :label end - context 'when build is retryable' do + context 'when job is retryable' do before do job.update(status: :failed) end @@ -49,7 +49,7 @@ describe JobEntity do end end - context 'when build is cancelable' do + context 'when job is cancelable' do before do job.update(status: :running) end diff --git a/spec/serializers/pipeline_details_entity_spec.rb b/spec/serializers/pipeline_details_entity_spec.rb index 03cc5ae9b63..5cb9b9945b6 100644 --- a/spec/serializers/pipeline_details_entity_spec.rb +++ b/spec/serializers/pipeline_details_entity_spec.rb @@ -91,6 +91,20 @@ describe PipelineDetailsEntity do end end + context 'when pipeline has commit statuses' do + let(:pipeline) { create(:ci_empty_pipeline) } + + before do + create(:generic_commit_status, pipeline: pipeline) + end + + it 'contains stages' do + expect(subject).to include(:details) + expect(subject[:details]).to include(:stages) + expect(subject[:details][:stages].first).to include(name: 'external') + end + end + context 'when pipeline has YAML errors' do let(:pipeline) do create(:ci_pipeline, config: { rspec: { invalid: :value } }) diff --git a/spec/serializers/stage_entity_spec.rb b/spec/serializers/stage_entity_spec.rb index 64b3217b809..40e303f7b89 100644 --- a/spec/serializers/stage_entity_spec.rb +++ b/spec/serializers/stage_entity_spec.rb @@ -54,6 +54,17 @@ describe StageEntity do it 'exposes the group key' do expect(subject).to include :groups end + + context 'and contains commit status' do + before do + create(:generic_commit_status, pipeline: pipeline, stage: 'test') + end + + it 'contains commit status' do + groups = subject[:groups].map { |group| group[:name] } + expect(groups).to include('generic') + end + end end end end |