2016-04-04 01:50:53 -04:00
|
|
|
require 'spec_helper'
|
|
|
|
|
2016-04-06 11:25:38 -04:00
|
|
|
feature 'Create New Merge Request', feature: true, js: true do
|
2016-04-04 01:50:53 -04:00
|
|
|
let(:user) { create(:user) }
|
|
|
|
let(:project) { create(:project, :public) }
|
|
|
|
|
|
|
|
before do
|
|
|
|
project.team << [user, :master]
|
|
|
|
|
|
|
|
login_as user
|
|
|
|
visit namespace_project_merge_requests_path(project.namespace, project)
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'generates a diff for an orphaned branch' do
|
|
|
|
click_link 'New Merge Request'
|
2016-04-06 11:25:38 -04:00
|
|
|
|
|
|
|
first('.js-source-branch').click
|
|
|
|
first('.dropdown-source-branch .dropdown-content a', text: 'orphaned-branch').click
|
|
|
|
|
2016-04-04 01:50:53 -04:00
|
|
|
click_button "Compare branches"
|
2016-04-06 11:25:38 -04:00
|
|
|
click_link "Changes"
|
2016-04-04 01:50:53 -04:00
|
|
|
|
|
|
|
expect(page).to have_content "README.md"
|
|
|
|
expect(page).to have_content "wm.png"
|
|
|
|
|
|
|
|
fill_in "merge_request_title", with: "Orphaned MR test"
|
|
|
|
click_button "Submit merge request"
|
|
|
|
|
2016-04-06 11:25:38 -04:00
|
|
|
click_link "Check out branch"
|
|
|
|
|
2016-04-04 01:50:53 -04:00
|
|
|
expect(page).to have_content 'git checkout -b orphaned-branch origin/orphaned-branch'
|
|
|
|
end
|
|
|
|
end
|