f3fba178b9
This removes the `ForkedProjectLink` model that has been replaced by the `ForkNetworkMember` and `ForkNetwork` combination. All existing relations have been adjusted to use these new models. The `forked_project_link` table has been dropped. The "Forks" count on the admin dashboard has been updated to count all `ForkNetworkMember` rows and deduct the number of `ForkNetwork` rows. This is because now the "root-project" of a fork network also has a `ForkNetworkMember` row. This count could become inaccurate when the root of a fork network is deleted.
25 lines
826 B
Ruby
25 lines
826 B
Ruby
require 'spec_helper'
|
|
|
|
describe RebaseWorker, '#perform' do
|
|
include ProjectForksHelper
|
|
|
|
context 'when rebasing an MR from a fork where upstream has protected branches' do
|
|
let(:upstream_project) { create(:project, :repository) }
|
|
let(:forked_project) { fork_project(upstream_project, nil, repository: true) }
|
|
|
|
let(:merge_request) do
|
|
create(:merge_request,
|
|
source_project: forked_project,
|
|
source_branch: 'feature_conflict',
|
|
target_project: upstream_project,
|
|
target_branch: 'master')
|
|
end
|
|
|
|
it 'sets the correct project for running hooks' do
|
|
expect(MergeRequests::RebaseService)
|
|
.to receive(:new).with(forked_project, merge_request.author).and_call_original
|
|
|
|
subject.perform(merge_request, merge_request.author)
|
|
end
|
|
end
|
|
end
|