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

33 lines
899 B
Ruby
Raw Normal View History

2016-04-07 15:51:16 -04:00
require 'spec_helper'
2016-04-07 18:44:59 -04:00
feature 'Edit Merge Request', feature: true do
2016-04-07 15:51:16 -04:00
let(:user) { create(:user) }
let(:project) { create(:project, :public) }
let(:merge_request) { create(:merge_request, :with_diffs, source_project: project) }
before do
project.team << [user, :master]
login_as user
visit edit_namespace_project_merge_request_path(project.namespace, project, merge_request)
end
2016-04-07 18:44:59 -04:00
context 'editing a MR' do
it 'has class js-quick-submit in form' do
2016-04-07 18:44:59 -04:00
expect(page).to have_selector('.js-quick-submit')
2016-04-07 15:51:16 -04:00
end
it 'warns about version conflict' do
merge_request.update(title: "New title")
fill_in 'merge_request_title', with: 'bug 345'
fill_in 'merge_request_description', with: 'bug description'
click_button 'Save changes'
expect(page).to have_content 'Someone edited the merge request the same time you did'
end
2016-04-07 15:51:16 -04:00
end
2016-04-07 18:44:59 -04:00
end