diff options
author | Sean McGivern <sean@mcgivern.me.uk> | 2017-05-02 14:14:41 +0300 |
---|---|---|
committer | Sean McGivern <sean@mcgivern.me.uk> | 2017-05-02 14:14:41 +0300 |
commit | 3efe534255a130f41d1427efd35ea84e39a99297 (patch) | |
tree | 0369fa3167b9c592069e8bf73505836d8e8ed6f9 /spec/services/merge_requests | |
parent | 59175a576723c2a105180c1e526d4bd2f597c377 (diff) | |
parent | ccac05dd90cb5cfa9abbeb11a50f953541eb83bb (diff) |
Merge branch '26488-target-disabled-mr' into 'master'
Fix 404 when upstream disabled merge requests
Closes #26488
See merge request !10427
Diffstat (limited to 'spec/services/merge_requests')
-rw-r--r-- | spec/services/merge_requests/build_service_spec.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/spec/services/merge_requests/build_service_spec.rb b/spec/services/merge_requests/build_service_spec.rb index be9f9ea2dec..6f9d1208b1d 100644 --- a/spec/services/merge_requests/build_service_spec.rb +++ b/spec/services/merge_requests/build_service_spec.rb @@ -261,6 +261,16 @@ describe MergeRequests::BuildService, services: true do end end + context 'upstream project has disabled merge requests' do + let(:upstream_project) { create(:empty_project, :merge_requests_disabled) } + let(:project) { create(:empty_project, forked_from_project: upstream_project) } + let(:commits) { Commit.decorate([commit_1], project) } + + it 'sets target project correctly' do + expect(merge_request.target_project).to eq(project) + end + end + context 'target_project is set and accessible by current_user' do let(:target_project) { create(:project, :public, :repository)} let(:commits) { Commit.decorate([commit_1], project) } |