BigW Consortium Gitlab

create_new_mr_spec.rb 912 Bytes
Newer Older
1 2
require 'spec_helper'

Phil Hughes committed
3
feature 'Create New Merge Request', feature: true, js: true do
4 5 6 7 8 9 10 11 12 13 14 15
  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'
Phil Hughes committed
16 17 18 19

    first('.js-source-branch').click
    first('.dropdown-source-branch .dropdown-content a', text: 'orphaned-branch').click

20
    click_button "Compare branches"
Phil Hughes committed
21
    click_link "Changes"
22 23 24 25 26 27 28

    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"

Phil Hughes committed
29 30
    click_link "Check out branch"

31 32 33
    expect(page).to have_content 'git checkout -b orphaned-branch origin/orphaned-branch'
  end
end