2016-11-21 09:16:57 -05:00
|
|
|
require 'spec_helper'
|
|
|
|
|
2016-12-06 09:42:11 -05:00
|
|
|
# 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-10-03 04:35:01 -04:00
|
|
|
describe 'Deleted source branch', :js do
|
2016-11-21 09:16:57 -05:00
|
|
|
let(:user) { create(:user) }
|
|
|
|
let(:merge_request) { create(:merge_request) }
|
|
|
|
|
|
|
|
before do
|
2017-06-21 19:44:10 -04:00
|
|
|
sign_in user
|
2016-11-21 09:16:57 -05:00
|
|
|
merge_request.project.team << [user, :master]
|
|
|
|
merge_request.update!(source_branch: 'this-branch-does-not-exist')
|
2017-07-06 12:20:50 -04:00
|
|
|
visit project_merge_request_path(merge_request.project, merge_request)
|
2016-11-21 09:16:57 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
it 'shows a message about missing source branch' do
|
|
|
|
expect(page).to have_content(
|
2017-05-09 00:15:34 -04:00
|
|
|
'Source branch does not exist.'
|
2016-11-21 09:16:57 -05:00
|
|
|
)
|
|
|
|
end
|
|
|
|
|
2016-12-28 15:24:05 -05:00
|
|
|
it 'still contains Discussion, Commits and Changes tabs' do
|
2016-11-21 09:16:57 -05:00
|
|
|
within '.merge-request-details' do
|
2016-12-28 15:24:05 -05:00
|
|
|
expect(page).to have_content('Discussion')
|
|
|
|
expect(page).to have_content('Commits')
|
|
|
|
expect(page).to have_content('Changes')
|
2016-11-21 09:16:57 -05:00
|
|
|
end
|
2016-12-28 15:24:05 -05:00
|
|
|
|
|
|
|
click_on 'Changes'
|
2017-05-17 14:25:13 -04:00
|
|
|
wait_for_requests
|
2016-12-28 15:24:05 -05:00
|
|
|
|
|
|
|
expect(page).to have_selector('.diffs.tab-pane .nothing-here-block')
|
2017-05-09 00:15:34 -04:00
|
|
|
expect(page).to have_content('Source branch does not exist.')
|
2016-11-21 09:16:57 -05:00
|
|
|
end
|
|
|
|
end
|