2019-04-11 08:17:24 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
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
|