gitlab-org--gitlab-foss/spec/features/merge_requests/deleted_source_branch_spec.rb

43 lines
1.3 KiB
Ruby
Raw Normal View History

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".
describe 'Deleted source branch', feature: true, js: true do
2016-12-28 15:24:05 -05:00
include WaitForAjax
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,
2016-12-28 15:24:05 -05:00
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
2016-12-28 15:24:05 -05:00
it 'still contains Discussion, Commits and Changes tabs' do
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')
end
2016-12-28 15:24:05 -05:00
click_on 'Changes'
wait_for_ajax
expect(page).to have_selector('.diffs.tab-pane .nothing-here-block')
expect(page).to have_content('Nothing to merge from this-branch-does-not-exist into feature')
end
end