2019-04-11 08:17:24 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2017-08-14 09:22:09 -04:00
|
|
|
require 'spec_helper'
|
|
|
|
|
2019-08-27 16:50:26 -04:00
|
|
|
describe Projects::ForksCountService, :use_clean_rails_memory_store_caching do
|
|
|
|
let(:project) { build(:project) }
|
|
|
|
subject { described_class.new(project) }
|
|
|
|
|
|
|
|
it_behaves_like 'a counter caching service'
|
|
|
|
|
2017-08-14 09:22:09 -04:00
|
|
|
describe '#count' do
|
|
|
|
it 'returns the number of forks' do
|
2019-08-27 16:50:26 -04:00
|
|
|
allow(subject).to receive(:uncached_count).and_return(1)
|
2017-08-14 09:22:09 -04:00
|
|
|
|
2019-08-27 16:50:26 -04:00
|
|
|
expect(subject.count).to eq(1)
|
2017-08-14 09:22:09 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|