|
|
@ -31,7 +31,7 @@ describe ProcessMergeRequestJob do |
|
|
|
let(:merge_request) { MergeRequest.create!(requesting_organisation: organisation, absorbing_organisation: organisation, merge_date: Time.zone.local(2022, 3, 3), existing_absorbing_organisation: false) } |
|
|
|
let(:merge_request) { MergeRequest.create!(requesting_organisation: organisation, absorbing_organisation: organisation, merge_date: Time.zone.local(2022, 3, 3), existing_absorbing_organisation: false) } |
|
|
|
|
|
|
|
|
|
|
|
it "calls the merge organisations service with correct arguments" do |
|
|
|
it "calls the merge organisations service with correct arguments" do |
|
|
|
expect(Merge::MergeOrganisationsService).to receive(:new).with(absorbing_organisation_id: organisation.id, merging_organisation_ids: [merging_organisation.id, other_merging_organisation.id], merge_date: Time.zone.local(2022, 3, 3), absorbing_organisation_active_from_merge_date: true) |
|
|
|
expect(Merge::MergeOrganisationsService).to receive(:new).with(absorbing_organisation_id: organisation.id, merging_organisation_ids: match_array([merging_organisation.id, other_merging_organisation.id]), merge_date: Time.zone.local(2022, 3, 3), absorbing_organisation_active_from_merge_date: true) |
|
|
|
|
|
|
|
|
|
|
|
job.perform(merge_request:) |
|
|
|
job.perform(merge_request:) |
|
|
|
expect(merge_request.reload.status).to eq("request_merged") |
|
|
|
expect(merge_request.reload.status).to eq("request_merged") |
|
|
|