Commit 7da6ac06 authored by Robert Speicher's avatar Robert Speicher

Merge branch 'sh-fix-failing-deploy-token-clones' into 'master'

Fix failing 500 errors when deploy tokens are used to clone

Closes gitlab-ee#7080

See merge request gitlab-org/gitlab-ce!20993
parents c60cb393 1436423a
......@@ -11,6 +11,7 @@ module Users
author.user
end
@user = nil unless @user.is_a?(User)
@activity = activity
end
......
......@@ -28,6 +28,18 @@ describe Users::ActivityService do
end
end
context 'when a bad object is passed' do
let(:fake_object) { double(username: 'hello') }
it 'does not record activity' do
service = described_class.new(fake_object, 'pull')
expect(service).not_to receive(:record_activity)
service.execute
end
end
context 'when last activity is today' do
let(:last_activity_on) { Date.today }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment