diff options
| author | Stan Hu <stanhu@gmail.com> | 2016-08-06 07:25:51 -0700 |
|---|---|---|
| committer | Stan Hu <stanhu@gmail.com> | 2016-08-10 09:28:21 -0700 |
| commit | 4955a47cb1c52168114364e45a2fccf6bc105452 (patch) | |
| tree | 50bb5ea1979a596edef53817aea75796686fc2a9 /spec | |
| parent | ae2d3c417075c83e169ab7662f3dd11e3b2bf043 (diff) | |
| download | gitlab-ce-4955a47cb1c52168114364e45a2fccf6bc105452.tar.gz | |
Clean up project destructionclean-up-project-destroy
Instead of redirecting from the project service to the service and back to the model,
put all destruction code in the service. Also removes a possible source of failure
where run_after_commit may not destroy the project.
Diffstat (limited to 'spec')
| -rw-r--r-- | spec/models/hooks/system_hook_spec.rb | 2 | ||||
| -rw-r--r-- | spec/services/delete_user_service_spec.rb | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/spec/models/hooks/system_hook_spec.rb b/spec/models/hooks/system_hook_spec.rb index 4078b9e4ff5..cbdf7eec082 100644 --- a/spec/models/hooks/system_hook_spec.rb +++ b/spec/models/hooks/system_hook_spec.rb @@ -38,7 +38,7 @@ describe SystemHook, models: true do end it "project_destroy hook" do - Projects::DestroyService.new(project, user, {}).pending_delete! + Projects::DestroyService.new(project, user, {}).async_execute expect(WebMock).to have_requested(:post, system_hook.url).with( body: /project_destroy/, diff --git a/spec/services/delete_user_service_spec.rb b/spec/services/delete_user_service_spec.rb index a65938fa03b..630458f9efc 100644 --- a/spec/services/delete_user_service_spec.rb +++ b/spec/services/delete_user_service_spec.rb @@ -15,7 +15,7 @@ describe DeleteUserService, services: true do end it 'will delete the project in the near future' do - expect_any_instance_of(Projects::DestroyService).to receive(:pending_delete!).once + expect_any_instance_of(Projects::DestroyService).to receive(:async_execute).once DeleteUserService.new(current_user).execute(user) end |
