Skip to content
Snippets Groups Projects

Fixes activation of project mirror when project is created.

@@ -16,6 +16,37 @@
expect(project.labels).not_to be_empty
end
context 'repository mirror' do
before do
opts.merge!(import_url: 'http://foo.com',
mirror: true,
mirror_user_id: user.id,
mirror_trigger_builds: true)
end
it 'sets the correct attributes if feature is enabled' do
stub_licensed_features(repository_mirrors: true)
project = create_project(user, opts)
expect(project).to be_valid
expect(project.mirror).to be true
expect(project.mirror_user_id).to eq(user.id)
expect(project.mirror_trigger_builds).to be true
end
it 'does not set mirror attributes if feature is disabled' do
stub_licensed_features(repository_mirrors: false)
project = create_project(user, opts)
expect(project).to be_valid
expect(project.mirror).to be false
expect(project.mirror_user_id).to be_nil
expect(project.mirror_trigger_builds).to be false
end
end
context 'user namespace' do
it do
project = create_project(user, opts)
Loading