Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-07-23 18:09:28 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-07-23 18:09:28 +0300
commit14fb5a922285d71fea67de59164ee4bb81ee3486 (patch)
treed3f585c54feb676aec2f14cc85fe32d615fd7fc0 /spec/serializers/merge_request_poll_widget_entity_spec.rb
parentd9b0b3243e3cd71a08ff5d4035b7882cc7a5a35f (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/serializers/merge_request_poll_widget_entity_spec.rb')
-rw-r--r--spec/serializers/merge_request_poll_widget_entity_spec.rb41
1 files changed, 35 insertions, 6 deletions
diff --git a/spec/serializers/merge_request_poll_widget_entity_spec.rb b/spec/serializers/merge_request_poll_widget_entity_spec.rb
index f0493699209..e5f88e31025 100644
--- a/spec/serializers/merge_request_poll_widget_entity_spec.rb
+++ b/spec/serializers/merge_request_poll_widget_entity_spec.rb
@@ -36,13 +36,28 @@ RSpec.describe MergeRequestPollWidgetEntity do
it 'returns merge_pipeline' do
pipeline.reload
- pipeline_payload = PipelineDetailsEntity
- .represent(pipeline, request: request)
- .as_json
+ pipeline_payload =
+ MergeRequests::PipelineEntity
+ .represent(pipeline, request: request)
+ .as_json
expect(subject[:merge_pipeline]).to eq(pipeline_payload)
end
+ context 'when merge_request_short_pipeline_serializer is disabled' do
+ it 'returns detailed info about pipeline' do
+ stub_feature_flags(merge_request_short_pipeline_serializer: false)
+
+ pipeline.reload
+ pipeline_payload =
+ PipelineDetailsEntity
+ .represent(pipeline, request: request)
+ .as_json
+
+ expect(subject[:merge_pipeline]).to eq(pipeline_payload)
+ end
+ end
+
context 'when user cannot read pipelines on target project' do
before do
project.add_guest(user)
@@ -222,13 +237,27 @@ RSpec.describe MergeRequestPollWidgetEntity do
let(:req) { double('request', current_user: user, project: project) }
it 'returns pipeline' do
- pipeline_payload = PipelineDetailsEntity
- .represent(pipeline, request: req)
- .as_json
+ pipeline_payload =
+ MergeRequests::PipelineEntity
+ .represent(pipeline, request: req)
+ .as_json
expect(subject[:pipeline]).to eq(pipeline_payload)
end
+ context 'when merge_request_short_pipeline_serializer is disabled' do
+ it 'returns detailed info about pipeline' do
+ stub_feature_flags(merge_request_short_pipeline_serializer: false)
+
+ pipeline_payload =
+ PipelineDetailsEntity
+ .represent(pipeline, request: req)
+ .as_json
+
+ expect(subject[:pipeline]).to eq(pipeline_payload)
+ end
+ end
+
it 'returns ci_status' do
expect(subject[:ci_status]).to eq('pending')
end