2017-08-01 18:03:07 +00:00
|
|
|
require 'rails_helper'
|
2016-11-21 14:16:57 +00:00
|
|
|
|
2016-12-06 14:42:11 +00: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.
|
2017-08-01 18:03:07 +00:00
|
|
|
# Please do not remove ":js".
|
|
|
|
describe 'Merge request > User sees MR with deleted source branch', :js do
|
|
|
|
let(:project) { create(:project, :public, :repository) }
|
|
|
|
let(:merge_request) { create(:merge_request, source_project: project) }
|
|
|
|
let(:user) { project.creator }
|
2016-11-21 14:16:57 +00:00
|
|
|
|
|
|
|
before do
|
|
|
|
merge_request.update!(source_branch: 'this-branch-does-not-exist')
|
2017-08-01 18:03:07 +00:00
|
|
|
sign_in(user)
|
|
|
|
visit project_merge_request_path(project, merge_request)
|
2016-11-21 14:16:57 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
it 'shows a message about missing source branch' do
|
2017-08-01 18:03:07 +00:00
|
|
|
expect(page).to have_content('Source branch does not exist.')
|
2016-11-21 14:16:57 +00:00
|
|
|
end
|
|
|
|
|
2016-12-28 20:24:05 +00:00
|
|
|
it 'still contains Discussion, Commits and Changes tabs' do
|
2016-11-21 14:16:57 +00:00
|
|
|
within '.merge-request-details' do
|
2016-12-28 20:24:05 +00:00
|
|
|
expect(page).to have_content('Discussion')
|
|
|
|
expect(page).to have_content('Commits')
|
|
|
|
expect(page).to have_content('Changes')
|
2016-11-21 14:16:57 +00:00
|
|
|
end
|
2016-12-28 20:24:05 +00:00
|
|
|
|
|
|
|
click_on 'Changes'
|
2017-05-17 18:25:13 +00:00
|
|
|
wait_for_requests
|
2016-12-28 20:24:05 +00:00
|
|
|
|
|
|
|
expect(page).to have_selector('.diffs.tab-pane .nothing-here-block')
|
2017-05-09 04:15:34 +00:00
|
|
|
expect(page).to have_content('Source branch does not exist.')
|
2016-11-21 14:16:57 +00:00
|
|
|
end
|
|
|
|
end
|