2019-07-31 22:56:46 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2017-09-10 17:25:29 +05:30
|
|
|
require 'spec_helper'
|
|
|
|
|
|
|
|
describe Projects::ForksCountService do
|
|
|
|
describe '#count' do
|
|
|
|
it 'returns the number of forks' do
|
2018-03-17 18:26:18 +05:30
|
|
|
project = build(:project, id: 42)
|
|
|
|
service = described_class.new(project)
|
2017-09-10 17:25:29 +05:30
|
|
|
|
2018-03-17 18:26:18 +05:30
|
|
|
allow(service).to receive(:uncached_count).and_return(1)
|
2017-09-10 17:25:29 +05:30
|
|
|
|
|
|
|
expect(service.count).to eq(1)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|