2017-08-14 09:22:09 -04:00
|
|
|
require 'spec_helper'
|
|
|
|
|
|
|
|
describe Projects::ForksCountService do
|
|
|
|
describe '#count' do
|
|
|
|
it 'returns the number of forks' do
|
2017-08-17 11:21:25 -04:00
|
|
|
project = build(:project, id: 42)
|
|
|
|
service = described_class.new(project)
|
2017-08-14 09:22:09 -04:00
|
|
|
|
2017-08-17 11:21:25 -04:00
|
|
|
allow(service).to receive(:uncached_count).and_return(1)
|
2017-08-14 09:22:09 -04:00
|
|
|
|
|
|
|
expect(service.count).to eq(1)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|