2016-11-21 14:16:57 +00:00
|
|
|
require 'spec_helper'
|
|
|
|
|
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.
|
|
|
|
# Please do not remove "js: true".
|
2016-11-21 14:16:57 +00:00
|
|
|
describe 'Deleted source branch', feature: true, js: true do
|
|
|
|
let(:user) { create(:user) }
|
|
|
|
let(:merge_request) { create(:merge_request) }
|
|
|
|
|
|
|
|
before do
|
|
|
|
login_as user
|
|
|
|
merge_request.project.team << [user, :master]
|
|
|
|
merge_request.update!(source_branch: 'this-branch-does-not-exist')
|
|
|
|
visit namespace_project_merge_request_path(
|
|
|
|
merge_request.project.namespace,
|
|
|
|
merge_request.project, merge_request
|
|
|
|
)
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'shows a message about missing source branch' do
|
|
|
|
expect(page).to have_content(
|
|
|
|
'Source branch this-branch-does-not-exist does not exist'
|
|
|
|
)
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'hides Discussion, Commits and Changes tabs' do
|
|
|
|
within '.merge-request-details' do
|
|
|
|
expect(page).to have_no_content('Discussion')
|
|
|
|
expect(page).to have_no_content('Commits')
|
|
|
|
expect(page).to have_no_content('Changes')
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|