diff options
author | Phil Hughes <me@iamphill.com> | 2018-07-10 12:35:16 +0300 |
---|---|---|
committer | Bob Van Landuyt <bob@vanlanduyt.co> | 2018-07-12 13:14:49 +0300 |
commit | 3a77664d1a550cfbedc92068926e4adae9c82b87 (patch) | |
tree | 49884555a4aa2fbaf5c29be1e6b4a5970fcbe104 /spec/serializers/merge_request_widget_entity_spec.rb | |
parent | 6a0ff9eb7cc5e95ba25ecd86aef34330c89bdeed (diff) |
Allow merge requests from forks to be opened in Web IDE
Closes #47460
Diffstat (limited to 'spec/serializers/merge_request_widget_entity_spec.rb')
-rw-r--r-- | spec/serializers/merge_request_widget_entity_spec.rb | 15 |
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) } |