2017-08-17 22:00:37 +05:30
|
|
|
require 'spec_helper'
|
|
|
|
|
|
|
|
# This test serves as a regression test for a bug that caused an error
|
|
|
|
# message to be shown by JavaScript when the source branch was deleted.
|
|
|
|
# Please do not remove "js: true".
|
2017-09-10 17:25:29 +05:30
|
|
|
describe 'Deleted source branch', js: true do
|
2017-08-17 22:00:37 +05:30
|
|
|
let(:user) { create(:user) }
|
|
|
|
let(:merge_request) { create(:merge_request) }
|
|
|
|
|
|
|
|
before do
|
2017-09-10 17:25:29 +05:30
|
|
|
sign_in user
|
2017-08-17 22:00:37 +05:30
|
|
|
merge_request.project.team << [user, :master]
|
|
|
|
merge_request.update!(source_branch: 'this-branch-does-not-exist')
|
2017-09-10 17:25:29 +05:30
|
|
|
visit project_merge_request_path(merge_request.project, merge_request)
|
2017-08-17 22:00:37 +05:30
|
|
|
end
|
|
|
|
|
|
|
|
it 'shows a message about missing source branch' do
|
|
|
|
expect(page).to have_content(
|
|
|
|
'Source branch does not exist.'
|
|
|
|
)
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'still contains Discussion, Commits and Changes tabs' do
|
|
|
|
within '.merge-request-details' do
|
|
|
|
expect(page).to have_content('Discussion')
|
|
|
|
expect(page).to have_content('Commits')
|
|
|
|
expect(page).to have_content('Changes')
|
|
|
|
end
|
|
|
|
|
|
|
|
click_on 'Changes'
|
2017-09-10 17:25:29 +05:30
|
|
|
wait_for_requests
|
2017-08-17 22:00:37 +05:30
|
|
|
|
|
|
|
expect(page).to have_selector('.diffs.tab-pane .nothing-here-block')
|
|
|
|
expect(page).to have_content('Source branch does not exist.')
|
|
|
|
end
|
|
|
|
end
|