|
|
|
|
@ -28,13 +28,13 @@ RSpec.describe "emails" do
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
it "raises an error when only merging organisations are given" do |
|
|
|
|
expect { task.invoke(nil, [1, 2]) }.to raise_error(RuntimeError, "Usage: rake merge:merge_organisations[absorbing_organisation_id, merging_organisation_ids]") |
|
|
|
|
expect { task.invoke(nil, "1,2") }.to raise_error(RuntimeError, "Usage: rake merge:merge_organisations[absorbing_organisation_id, merging_organisation_ids]") |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
it "raises runs the service with correct organisation IDs" do |
|
|
|
|
expect(Merge::MergeOrganisationsService).to receive(:new).with(absorbing_organisation_id: 1, merging_organisation_ids: [2, 3]).once |
|
|
|
|
expect(merge_organisations_service).to receive(:call).once |
|
|
|
|
task.invoke(1, [2, 3]) |
|
|
|
|
task.invoke(1, "2,3") |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
|