Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/services/users/update_assigned_open_issue_count_service_spec.rb')
-rw-r--r--spec/services/users/update_assigned_open_issue_count_service_spec.rb49
1 files changed, 0 insertions, 49 deletions
diff --git a/spec/services/users/update_assigned_open_issue_count_service_spec.rb b/spec/services/users/update_assigned_open_issue_count_service_spec.rb
deleted file mode 100644
index 55fc60a7893..00000000000
--- a/spec/services/users/update_assigned_open_issue_count_service_spec.rb
+++ /dev/null
@@ -1,49 +0,0 @@
-# frozen_string_literal: true
-
-require 'spec_helper'
-
-RSpec.describe Users::UpdateAssignedOpenIssueCountService do
- let_it_be(:user) { create(:user) }
-
- describe '#initialize' do
- context 'incorrect arguments provided' do
- it 'raises an error if there are no target user' do
- expect { described_class.new(target_user: nil) }.to raise_error(ArgumentError, /Please provide a target user/)
- expect { described_class.new(target_user: "nonsense") }.to raise_error(ArgumentError, /Please provide a target user/)
- end
- end
-
- context 'when correct arguments provided' do
- it 'is successful' do
- expect { described_class.new(target_user: user) }.not_to raise_error
- end
- end
- end
-
- describe "#execute", :clean_gitlab_redis_cache do
- let(:fake_update_service) { double }
- let(:fake_issue_count_service) { double }
- let(:provided_value) { nil }
-
- subject { described_class.new(target_user: user).execute }
-
- context 'successful' do
- it 'returns a success response' do
- expect(subject).to be_success
- end
-
- it 'writes the cache with the new value' do
- expect(Rails.cache).to receive(:write).with(['users', user.id, 'assigned_open_issues_count'], 0, expires_in: User::COUNT_CACHE_VALIDITY_PERIOD)
-
- subject
- end
-
- it 'calls the issues finder to get the latest value' do
- expect(IssuesFinder).to receive(:new).with(user, assignee_id: user.id, state: 'opened', non_archived: true).and_return(fake_issue_count_service)
- expect(fake_issue_count_service).to receive(:execute)
-
- subject
- end
- end
- end
-end