2017-08-17 22:00:37 +05:30
|
|
|
require 'spec_helper'
|
|
|
|
|
2017-09-10 17:25:29 +05:30
|
|
|
describe 'Target branch', js: true do
|
2017-08-17 22:00:37 +05:30
|
|
|
let(:user) { create(:user) }
|
|
|
|
let(:merge_request) { create(:merge_request) }
|
|
|
|
let(:project) { merge_request.project }
|
|
|
|
|
|
|
|
def path_to_merge_request
|
2017-09-10 17:25:29 +05:30
|
|
|
project_merge_request_path(project, merge_request)
|
2017-08-17 22:00:37 +05:30
|
|
|
end
|
|
|
|
|
|
|
|
before do
|
2017-09-10 17:25:29 +05:30
|
|
|
sign_in user
|
2017-08-17 22:00:37 +05:30
|
|
|
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(
|
|
|
|
'Target branch does not exist'
|
|
|
|
)
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'does not show link to target branch' do
|
|
|
|
expect(page).not_to have_selector('.mr-widget-body .js-branch-text a')
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|