BigW Consortium Gitlab

user_creates_mr_spec.rb 760 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
require 'rails_helper'

describe 'Merge request > User creates MR' do
  it_behaves_like 'a creatable merge request'

  context 'from a forked project' do
    include ProjectForksHelper

    let(:canonical_project) { create(:project, :public, :repository) }

    let(:source_project) do
      fork_project(canonical_project, user,
        repository: true,
        namespace: user.namespace)
    end

    context 'to canonical project' do
      it_behaves_like 'a creatable merge request'
    end

    context 'to another forked project' do
      let(:target_project) do
        fork_project(canonical_project, user,
          repository: true,
          namespace: user.namespace)
      end

      it_behaves_like 'a creatable merge request'
    end
  end
end