diff options
author | Sean McGivern <sean@gitlab.com> | 2019-04-29 16:42:16 +0300 |
---|---|---|
committer | Sean McGivern <sean@gitlab.com> | 2019-04-29 17:31:29 +0300 |
commit | 9bc3dfea4f365d5dc0b93a5fef0418dfad971361 (patch) | |
tree | 366b28a81deab1698697c2e8b66168016d87cfd8 /spec/services/todos | |
parent | d232137aa7d857396060f9ab02d4e99cf8081285 (diff) |
Stop serialising project when removing todos
`Todos::Destroy::EntityLeaveService#project_ids` was returning
ActiveRecord objects with IDs, not simply IDs. That means we were
serialising more than we needed to in Sidekiq.
We can simply rename this method to `#projects` as this class doesn't
use any of the superclass methods that would use `#project_ids`.
Diffstat (limited to 'spec/services/todos')
-rw-r--r-- | spec/services/todos/destroy/entity_leave_service_spec.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/spec/services/todos/destroy/entity_leave_service_spec.rb b/spec/services/todos/destroy/entity_leave_service_spec.rb index 1447b9d4126..2a553e18807 100644 --- a/spec/services/todos/destroy/entity_leave_service_spec.rb +++ b/spec/services/todos/destroy/entity_leave_service_spec.rb @@ -75,6 +75,13 @@ describe Todos::Destroy::EntityLeaveService do project.update!(visibility_level: Gitlab::VisibilityLevel::INTERNAL) end + it 'enqueues the PrivateFeaturesWorker' do + expect(TodosDestroyer::PrivateFeaturesWorker) + .to receive(:perform_async).with(project.id, user.id) + + subject + end + context 'confidential issues' do context 'when a user is not an author of confidential issue' do it 'removes only confidential issues todos' do @@ -246,6 +253,13 @@ describe Todos::Destroy::EntityLeaveService do project.update!(visibility_level: Gitlab::VisibilityLevel::INTERNAL) end + it 'enqueues the PrivateFeaturesWorker' do + expect(TodosDestroyer::PrivateFeaturesWorker) + .to receive(:perform_async).with(project.id, user.id) + + subject + end + context 'when user is not member' do it 'removes only confidential issues todos' do expect { subject }.to change { Todo.count }.from(5).to(4) |