2019-07-25 05:24:42 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2019-08-29 07:56:52 +00:00
|
|
|
require 'spec_helper'
|
2017-08-01 18:03:07 +00:00
|
|
|
|
2020-06-16 18:09:01 +00:00
|
|
|
RSpec.describe 'Merge request > User sees MR from deleted forked project', :js do
|
2018-08-31 17:16:34 +00:00
|
|
|
include ProjectForksHelper
|
|
|
|
|
2017-08-01 18:03:07 +00:00
|
|
|
let(:project) { create(:project, :public, :repository) }
|
|
|
|
let(:user) { project.creator }
|
2018-08-31 17:16:34 +00:00
|
|
|
let(:forked_project) { fork_project(project, nil, repository: true) }
|
2017-08-01 18:03:07 +00:00
|
|
|
let!(:merge_request) do
|
2018-08-31 17:16:34 +00:00
|
|
|
create(:merge_request_with_diffs, source_project: forked_project,
|
2017-08-01 18:03:07 +00:00
|
|
|
target_project: project,
|
|
|
|
description: 'Test merge request')
|
|
|
|
end
|
|
|
|
|
|
|
|
before do
|
2021-05-12 03:10:21 +00:00
|
|
|
MergeRequests::MergeService.new(project: project, current_user: user).execute(merge_request)
|
2018-08-31 17:16:34 +00:00
|
|
|
forked_project.destroy!
|
2017-08-01 18:03:07 +00:00
|
|
|
sign_in(user)
|
|
|
|
visit project_merge_request_path(project, merge_request)
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'user can access merge request' do
|
|
|
|
expect(page).to have_content 'Test merge request'
|
|
|
|
expect(page).to have_content "(removed):#{merge_request.source_branch}"
|
|
|
|
end
|
|
|
|
end
|