summaryrefslogtreecommitdiff
path: root/spec/services/projects/forks_count_service_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/services/projects/forks_count_service_spec.rb')
-rw-r--r--spec/services/projects/forks_count_service_spec.rb32
1 files changed, 3 insertions, 29 deletions
diff --git a/spec/services/projects/forks_count_service_spec.rb b/spec/services/projects/forks_count_service_spec.rb
index cf299c5d09b..9f8e7ee18a8 100644
--- a/spec/services/projects/forks_count_service_spec.rb
+++ b/spec/services/projects/forks_count_service_spec.rb
@@ -1,40 +1,14 @@
require 'spec_helper'
describe Projects::ForksCountService do
- let(:project) { build(:project, id: 42) }
- let(:service) { described_class.new(project) }
-
describe '#count' do
it 'returns the number of forks' do
- allow(service).to receive(:uncached_count).and_return(1)
-
- expect(service.count).to eq(1)
- end
-
- it 'caches the forks count', :use_clean_rails_memory_store_caching do
- expect(service).to receive(:uncached_count).once.and_return(1)
+ project = build(:project, id: 42)
+ service = described_class.new(project)
- 2.times { service.count }
- end
- end
-
- describe '#refresh_cache', :use_clean_rails_memory_store_caching do
- it 'refreshes the cache' do
- expect(service).to receive(:uncached_count).once.and_return(1)
-
- service.refresh_cache
+ allow(service).to receive(:uncached_count).and_return(1)
expect(service.count).to eq(1)
end
end
-
- describe '#delete_cache', :use_clean_rails_memory_store_caching do
- it 'removes the cache' do
- expect(service).to receive(:uncached_count).twice.and_return(1)
-
- service.count
- service.delete_cache
- service.count
- end
- end
end