diff options
Diffstat (limited to 'spec/support/shared_examples/controllers/repositories/git_http_controller_shared_examples.rb')
-rw-r--r-- | spec/support/shared_examples/controllers/repositories/git_http_controller_shared_examples.rb | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/spec/support/shared_examples/controllers/repositories/git_http_controller_shared_examples.rb b/spec/support/shared_examples/controllers/repositories/git_http_controller_shared_examples.rb index 3a7588a5cc9..cc28a79b4ca 100644 --- a/spec/support/shared_examples/controllers/repositories/git_http_controller_shared_examples.rb +++ b/spec/support/shared_examples/controllers/repositories/git_http_controller_shared_examples.rb @@ -61,9 +61,14 @@ RSpec.shared_examples Repositories::GitHttpController do end it 'updates the user activity' do - expect_next_instance_of(Users::ActivityService) do |activity_service| - expect(activity_service).to receive(:execute) - end + activity_project = container.is_a?(PersonalSnippet) ? nil : project + + activity_service = instance_double(Users::ActivityService) + + args = { author: user, project: activity_project, namespace: activity_project&.namespace } + expect(Users::ActivityService).to receive(:new).with(args).and_return(activity_service) + + expect(activity_service).to receive(:execute) get :info_refs, params: params end |