diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-09-18 17:02:45 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-09-18 17:02:45 +0300 |
commit | 80f61b4035607d7cd87de993b8f5e996bde3481f (patch) | |
tree | 06b12f51e97d87192e3dd0e05edf55143645b894 /spec/services | |
parent | 4ab54c2233e91f60a80e5b6fa2181e6899fdcc3e (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/services')
5 files changed, 19 insertions, 9 deletions
diff --git a/spec/services/ci/archive_trace_service_spec.rb b/spec/services/ci/archive_trace_service_spec.rb index 454db3d5a48..47bc26c0521 100644 --- a/spec/services/ci/archive_trace_service_spec.rb +++ b/spec/services/ci/archive_trace_service_spec.rb @@ -62,7 +62,7 @@ describe Ci::ArchiveTraceService, '#execute' do expect(Gitlab::Sentry) .to receive(:track_exception) .with(::Gitlab::Ci::Trace::ArchiveError, - issue_url: 'https://gitlab.com/gitlab-org/gitlab-ce/issues/51502', + issue_url: 'https://gitlab.com/gitlab-org/gitlab-foss/issues/51502', extra: { job_id: job.id } ).once expect(Sidekiq.logger).to receive(:warn).with( diff --git a/spec/services/members/destroy_service_spec.rb b/spec/services/members/destroy_service_spec.rb index 7dce7f035d4..effcaf53535 100644 --- a/spec/services/members/destroy_service_spec.rb +++ b/spec/services/members/destroy_service_spec.rb @@ -223,7 +223,7 @@ describe Members::DestroyService do group.add_owner(current_user) end - # Regression spec for issue: https://gitlab.com/gitlab-org/gitlab-ce/issues/32504 + # Regression spec for issue: https://gitlab.com/gitlab-org/gitlab-foss/issues/32504 it_behaves_like 'a service destroying a member' do let(:member) { project_invited_member } end diff --git a/spec/services/projects/container_repository/cleanup_tags_service_spec.rb b/spec/services/projects/container_repository/cleanup_tags_service_spec.rb index 0659130bed2..14247f1c71e 100644 --- a/spec/services/projects/container_repository/cleanup_tags_service_spec.rb +++ b/spec/services/projects/container_repository/cleanup_tags_service_spec.rb @@ -83,7 +83,7 @@ describe Projects::ContainerRepository::CleanupTagsService do end it 'does not remove the tag' do - # Issue: https://gitlab.com/gitlab-org/gitlab-ce/issues/21405 + # Issue: https://gitlab.com/gitlab-org/gitlab-foss/issues/21405 is_expected.to include(status: :success, deleted: []) end diff --git a/spec/services/projects/create_service_spec.rb b/spec/services/projects/create_service_spec.rb index 8178b7d2ba2..814bf912c8c 100644 --- a/spec/services/projects/create_service_spec.rb +++ b/spec/services/projects/create_service_spec.rb @@ -348,7 +348,7 @@ describe Projects::CreateService, '#execute' do context 'when a bad service template is created' do it 'sets service to be inactive' do - opts[:import_url] = 'http://www.gitlab.com/gitlab-org/gitlab-ce' + opts[:import_url] = 'http://www.gitlab.com/gitlab-org/gitlab-foss' create(:service, type: 'DroneCiService', project: nil, template: true, active: true) project = create_project(user, opts) diff --git a/spec/services/projects/fork_service_spec.rb b/spec/services/projects/fork_service_spec.rb index 0c109e26a6a..b759830d603 100644 --- a/spec/services/projects/fork_service_spec.rb +++ b/spec/services/projects/fork_service_spec.rb @@ -53,7 +53,7 @@ describe Projects::ForkService do # This test is here because we had a bug where the from-project lost its # avatar after being forked. - # https://gitlab.com/gitlab-org/gitlab-ce/issues/26158 + # https://gitlab.com/gitlab-org/gitlab-foss/issues/26158 it "after forking the from-project still has its avatar" do # If we do not fork the project first we cannot detect the bug. expect(to_project).to be_persisted @@ -119,6 +119,7 @@ describe Projects::ForkService do context 'repository in legacy storage already exists' do let(:repository_storage) { 'default' } let(:repository_storage_path) { Gitlab.config.repositories.storages[repository_storage].legacy_disk_path } + let(:params) { { namespace: @to_user.namespace } } before do stub_application_setting(hashed_storage_enabled: false) @@ -129,12 +130,21 @@ describe Projects::ForkService do gitlab_shell.remove_repository(repository_storage, "#{@to_user.namespace.full_path}/#{@from_project.path}") end + subject { fork_project(@from_project, @to_user, params) } + it 'does not allow creation' do - to_project = fork_project(@from_project, @to_user, namespace: @to_user.namespace) + expect(subject).not_to be_persisted + expect(subject.errors.messages).to have_key(:base) + expect(subject.errors.messages[:base].first).to match('There is already a repository with that name on disk') + end - expect(to_project).not_to be_persisted - expect(to_project.errors.messages).to have_key(:base) - expect(to_project.errors.messages[:base].first).to match('There is already a repository with that name on disk') + context 'when repository disk validation is explicitly skipped' do + let(:params) { super().merge(skip_disk_validation: true) } + + it 'allows fork project creation' do + expect(subject).to be_persisted + expect(subject.errors.messages).to be_empty + end end end |