summaryrefslogtreecommitdiff
path: root/spec/serializers
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-03-26 18:08:03 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-03-26 18:08:03 +0000
commitdc003cd08b4cb72fecbb03aa978ea0c53c03aeb4 (patch)
tree5e77ce228c33619201ac6706b9789d4a2eed2a3b /spec/serializers
parente80e0dd64fbb04f60394cb1bb08e17dbcb22b8ce (diff)
downloadgitlab-ce-dc003cd08b4cb72fecbb03aa978ea0c53c03aeb4.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/serializers')
-rw-r--r--spec/serializers/merge_request_poll_widget_entity_spec.rb11
1 files changed, 10 insertions, 1 deletions
diff --git a/spec/serializers/merge_request_poll_widget_entity_spec.rb b/spec/serializers/merge_request_poll_widget_entity_spec.rb
index 0593dd527cc..29d35fdc811 100644
--- a/spec/serializers/merge_request_poll_widget_entity_spec.rb
+++ b/spec/serializers/merge_request_poll_widget_entity_spec.rb
@@ -138,7 +138,7 @@ describe MergeRequestPollWidgetEntity do
end
describe 'pipeline' do
- let(:pipeline) { create(:ci_empty_pipeline, project: project, ref: resource.source_branch, sha: resource.source_branch_sha, head_pipeline_of: resource) }
+ let!(:pipeline) { create(:ci_empty_pipeline, project: project, ref: resource.source_branch, sha: resource.source_branch_sha, head_pipeline_of: resource) }
before do
allow_any_instance_of(MergeRequestPresenter).to receive(:can?).and_call_original
@@ -158,6 +158,10 @@ describe MergeRequestPollWidgetEntity do
expect(subject[:pipeline]).to eq(pipeline_payload)
end
+
+ it 'returns ci_status' do
+ expect(subject[:ci_status]).to eq('pending')
+ end
end
context 'when is not up to date' do
@@ -171,10 +175,15 @@ describe MergeRequestPollWidgetEntity do
context 'when user does not have access to pipelines' do
let(:result) { false }
+ let(:req) { double('request', current_user: user, project: project) }
it 'does not have pipeline' do
expect(subject[:pipeline]).to eq(nil)
end
+
+ it 'does not return ci_status' do
+ expect(subject[:ci_status]).to eq(nil)
+ end
end
end
end