diff options
Diffstat (limited to 'spec/services/projects')
-rw-r--r-- | spec/services/projects/fork_service_spec.rb | 2 | ||||
-rw-r--r-- | spec/services/projects/unlink_fork_service_spec.rb | 11 |
2 files changed, 12 insertions, 1 deletions
diff --git a/spec/services/projects/fork_service_spec.rb b/spec/services/projects/fork_service_spec.rb index df02f8ea15d..276656656ec 100644 --- a/spec/services/projects/fork_service_spec.rb +++ b/spec/services/projects/fork_service_spec.rb @@ -403,7 +403,7 @@ RSpec.describe Projects::ForkService do end context 'when forking with object pools' do - let(:fork_from_project) { create(:project, :public) } + let(:fork_from_project) { create(:project, :repository, :public) } let(:forker) { create(:user) } context 'when no pool exists' do diff --git a/spec/services/projects/unlink_fork_service_spec.rb b/spec/services/projects/unlink_fork_service_spec.rb index 2a8965e62ce..90def365fca 100644 --- a/spec/services/projects/unlink_fork_service_spec.rb +++ b/spec/services/projects/unlink_fork_service_spec.rb @@ -207,6 +207,17 @@ RSpec.describe Projects::UnlinkForkService, :use_clean_rails_memory_store_cachin end end + context 'a project with pool repository' do + let(:project) { create(:project, :public, :repository) } + let!(:pool_repository) { create(:pool_repository, :ready, source_project: project) } + + subject { described_class.new(project, user) } + + it 'when unlinked leaves pool repository' do + expect { subject.execute }.to change { project.reload.has_pool_repository? }.from(true).to(false) + end + end + context 'when given project is not part of a fork network' do let!(:project_without_forks) { create(:project, :public) } |