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:
authorShinya Maeda <shinya@gitlab.com>2019-04-02 10:07:11 +0300
committerShinya Maeda <shinya@gitlab.com>2019-04-02 11:55:06 +0300
commita04e1d5e32f7ae1740ba8b9daaf3f71a5048126c (patch)
treece9b5458a09928c9827c1bc7e89ec57f97451a52 /spec/serializers
parentba23d6377c650ecaac420c8085a2cd82737d3ced (diff)
Backport EE change
This is for merge request pipelines
Diffstat (limited to 'spec/serializers')
-rw-r--r--spec/serializers/merge_request_widget_entity_spec.rb4
-rw-r--r--spec/serializers/pipeline_entity_spec.rb10
2 files changed, 14 insertions, 0 deletions
diff --git a/spec/serializers/merge_request_widget_entity_spec.rb b/spec/serializers/merge_request_widget_entity_spec.rb
index 727fd8951f2..0e99ef38d2f 100644
--- a/spec/serializers/merge_request_widget_entity_spec.rb
+++ b/spec/serializers/merge_request_widget_entity_spec.rb
@@ -13,6 +13,10 @@ describe MergeRequestWidgetEntity do
described_class.new(resource, request: request).as_json
end
+ it 'has the latest sha of the target branch' do
+ is_expected.to include(:target_branch_sha)
+ end
+
describe 'source_project_full_path' do
it 'includes the full path of the source project' do
expect(subject[:source_project_full_path]).to be_present
diff --git a/spec/serializers/pipeline_entity_spec.rb b/spec/serializers/pipeline_entity_spec.rb
index 1d992e8a483..dba7fd91747 100644
--- a/spec/serializers/pipeline_entity_spec.rb
+++ b/spec/serializers/pipeline_entity_spec.rb
@@ -143,6 +143,11 @@ describe PipelineEntity do
expect(subject[:flags][:detached_merge_request_pipeline]).to be_truthy
end
+ it 'does not expose source sha and target sha' do
+ expect(subject[:source_sha]).to be_nil
+ expect(subject[:target_sha]).to be_nil
+ end
+
context 'when user is a developer' do
before do
project.add_developer(user)
@@ -189,6 +194,11 @@ describe PipelineEntity do
it 'makes atached flag true' do
expect(subject[:flags][:merge_request_pipeline]).to be_truthy
end
+
+ it 'exposes source sha and target sha' do
+ expect(subject[:source_sha]).to be_present
+ expect(subject[:target_sha]).to be_present
+ end
end
end
end