Follow-up from "Move transfer service package logic specs to core [RUN AS-IF-FOSS]"
The following discussions from !37264 (merged) should be addressed:
-
@tkuah started a discussion: We can improve this by wrapping into one shared example instead. Something like:
shared_examples 'has_package' do context 'package of package_type exists' do let!(:package) { create("#{package_type}_package", project: project) } it { is_expected.to be true } end context 'package of package_type does not exist' do it { is_expected.to be false } end end
context 'with maven packages' do it_behaves_like 'has_package' do let(:package_type) { :maven } end end
-
@tkuah started a discussion: It might be better to state in the spec name that we are passing in
nil
toproject.has_packages?
-
@tkuah started a discussion: different_root_ancestor? && npm_packages.exists?
Logically this is the same ?
-
@tkuah started a discussion: expect(transfer_service.error).to be_empty
-
@tkuah started a discussion: expect(transfer_service.error).to be_empty
-
@tkuah started a discussion: Should we also assert that the group does not change its
parent
? -
@tkuah started a discussion: let_it_be(:group) { create(:group, :public) }
Use
let_it_be
for performance so that we don't creategroup
multiple times -
@tkuah started a discussion: let_it_be(:group) { create(:group, :public) }
Edited by Giorgenes Gelatti