diff options
author | Paul Slaughter <pslaughter@gitlab.com> | 2018-10-03 12:08:00 +0300 |
---|---|---|
committer | Paul Slaughter <pslaughter@gitlab.com> | 2018-10-03 21:18:21 +0300 |
commit | becb86ea4e8032788b151caac004b2635b57c6a4 (patch) | |
tree | fbad0bec9e69fb82d6a72967ccae2812bbd25eb9 /spec/serializers/commit_entity_spec.rb | |
parent | 5a286eb7a3a0c395d35c722ce6a067aca47473f2 (diff) |
Add pipeline status to diffs/commit_item
**Notes:**
- Also exposes commit.pipeline_status_path in diffs.json
Diffstat (limited to 'spec/serializers/commit_entity_spec.rb')
-rw-r--r-- | spec/serializers/commit_entity_spec.rb | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/spec/serializers/commit_entity_spec.rb b/spec/serializers/commit_entity_spec.rb index b8cd24c69a6..b9995818e98 100644 --- a/spec/serializers/commit_entity_spec.rb +++ b/spec/serializers/commit_entity_spec.rb @@ -66,7 +66,7 @@ describe CommitEntity do context 'when type is "full"' do let(:entity) do - described_class.new(commit, request: request, type: :full) + described_class.new(commit, request: request, type: :full, pipeline_ref: project.default_branch, pipeline_project: project) end it 'exposes extra properties' do @@ -84,6 +84,16 @@ describe CommitEntity do expect(subject.fetch(:signature_html)).to be SIGNATURE_HTML end end + + context 'when commit has pipeline' do + before do + create(:ci_pipeline, project: project, sha: commit.id) + end + + it 'exposes "pipeline_status_path"' do + expect(subject.fetch(:pipeline_status_path)).not_to be_nil + end + end end context 'when commit_url_params is set' do |