2016-12-03 21:45:48 +00:00
|
|
|
require 'spec_helper'
|
|
|
|
|
2017-10-03 08:35:01 +00:00
|
|
|
describe 'Target branch', :js do
|
2016-12-03 21:45:48 +00:00
|
|
|
let(:user) { create(:user) }
|
|
|
|
let(:merge_request) { create(:merge_request) }
|
|
|
|
let(:project) { merge_request.project }
|
|
|
|
|
|
|
|
def path_to_merge_request
|
2017-07-06 16:20:50 +00:00
|
|
|
project_merge_request_path(project, merge_request)
|
2016-12-03 21:45:48 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
before do
|
2017-06-21 23:44:10 +00:00
|
|
|
sign_in user
|
2016-12-03 21:45:48 +00:00
|
|
|
project.team << [user, :master]
|
|
|
|
end
|
|
|
|
|
|
|
|
context 'when branch was deleted' do
|
|
|
|
before do
|
|
|
|
DeleteBranchService.new(project, user).execute('feature')
|
|
|
|
visit path_to_merge_request
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'shows a message about missing target branch' do
|
|
|
|
expect(page).to have_content(
|
2017-05-09 04:15:34 +00:00
|
|
|
'Target branch does not exist'
|
2016-12-03 21:45:48 +00:00
|
|
|
)
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'does not show link to target branch' do
|
2017-05-09 04:15:34 +00:00
|
|
|
expect(page).not_to have_selector('.mr-widget-body .js-branch-text a')
|
2016-12-03 21:45:48 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|