summaryrefslogtreecommitdiff
path: root/spec/serializers/merge_request_widget_entity_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/serializers/merge_request_widget_entity_spec.rb')
-rw-r--r--spec/serializers/merge_request_widget_entity_spec.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/spec/serializers/merge_request_widget_entity_spec.rb b/spec/serializers/merge_request_widget_entity_spec.rb
index d2072198d83..0ba2539a717 100644
--- a/spec/serializers/merge_request_widget_entity_spec.rb
+++ b/spec/serializers/merge_request_widget_entity_spec.rb
@@ -11,6 +11,21 @@ describe MergeRequestWidgetEntity do
described_class.new(resource, request: request).as_json
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
+ end
+
+ context 'when the source project is missing' do
+ it 'returns `nil` for the source project' do
+ resource.allow_broken = true
+ resource.update!(source_project: nil)
+
+ expect(subject[:source_project_full_path]).to be_nil
+ end
+ end
+ 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) }