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