Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-01-20 15:09:02 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-01-20 15:09:02 +0300
commit98252e0dd60cbcb316231085e206d9872f243b8a (patch)
tree304021f4190aabcc74f1359866c0efff84995729 /spec
parent2ee5991b42717969af93cb30d863aafab04dff8a (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec')
-rw-r--r--spec/features/merge_request/user_sees_deployment_widget_spec.rb2
-rw-r--r--spec/frontend/vue_mr_widget/deployment/deployment_spec.js42
-rw-r--r--spec/lib/gitlab/bitbucket_server_import/importer_spec.rb8
-rw-r--r--spec/models/project_services/pipelines_email_service_spec.rb4
-rw-r--r--spec/models/project_spec.rb4
-rw-r--r--spec/requests/api/internal/base_spec.rb6
-rw-r--r--spec/support/shared_examples/repo_type_shared_examples.rb4
7 files changed, 39 insertions, 31 deletions
diff --git a/spec/features/merge_request/user_sees_deployment_widget_spec.rb b/spec/features/merge_request/user_sees_deployment_widget_spec.rb
index 99c9e9dc501..3b599fcacb1 100644
--- a/spec/features/merge_request/user_sees_deployment_widget_spec.rb
+++ b/spec/features/merge_request/user_sees_deployment_widget_spec.rb
@@ -96,7 +96,7 @@ describe 'Merge request > User sees deployment widget', :js do
visit project_merge_request_path(project, merge_request)
wait_for_requests
- expect(page).to have_content("Canceled deploy to #{environment.name}")
+ expect(page).to have_content("Canceled deployment to #{environment.name}")
expect(page).not_to have_css('.js-deploy-time')
end
end
diff --git a/spec/frontend/vue_mr_widget/deployment/deployment_spec.js b/spec/frontend/vue_mr_widget/deployment/deployment_spec.js
index 2902c8280dd..ec7be6b64fc 100644
--- a/spec/frontend/vue_mr_widget/deployment/deployment_spec.js
+++ b/spec/frontend/vue_mr_widget/deployment/deployment_spec.js
@@ -56,27 +56,27 @@ describe('Deployment component', () => {
const deployGroup = [DeploymentViewButton, DeploymentStopButton];
describe.each`
- status | previous | deploymentDetails | text | actionButtons
- ${CREATED} | ${true} | ${deployDetail} | ${'Can deploy manually to'} | ${deployGroup}
- ${CREATED} | ${true} | ${noDetails} | ${'Will deploy to'} | ${deployGroup}
- ${CREATED} | ${false} | ${deployDetail} | ${'Can deploy manually to'} | ${noActions}
- ${CREATED} | ${false} | ${noDetails} | ${'Will deploy to'} | ${noActions}
- ${RUNNING} | ${true} | ${deployDetail} | ${'Deploying to'} | ${deployGroup}
- ${RUNNING} | ${true} | ${noDetails} | ${'Deploying to'} | ${deployGroup}
- ${RUNNING} | ${false} | ${deployDetail} | ${'Deploying to'} | ${noActions}
- ${RUNNING} | ${false} | ${noDetails} | ${'Deploying to'} | ${noActions}
- ${SUCCESS} | ${true} | ${deployDetail} | ${'Deployed to'} | ${deployGroup}
- ${SUCCESS} | ${true} | ${noDetails} | ${'Deployed to'} | ${deployGroup}
- ${SUCCESS} | ${false} | ${deployDetail} | ${'Deployed to'} | ${deployGroup}
- ${SUCCESS} | ${false} | ${noDetails} | ${'Deployed to'} | ${deployGroup}
- ${FAILED} | ${true} | ${deployDetail} | ${'Failed to deploy to'} | ${deployGroup}
- ${FAILED} | ${true} | ${noDetails} | ${'Failed to deploy to'} | ${deployGroup}
- ${FAILED} | ${false} | ${deployDetail} | ${'Failed to deploy to'} | ${noActions}
- ${FAILED} | ${false} | ${noDetails} | ${'Failed to deploy to'} | ${noActions}
- ${CANCELED} | ${true} | ${deployDetail} | ${'Canceled deploy to'} | ${deployGroup}
- ${CANCELED} | ${true} | ${noDetails} | ${'Canceled deploy to'} | ${deployGroup}
- ${CANCELED} | ${false} | ${deployDetail} | ${'Canceled deploy to'} | ${noActions}
- ${CANCELED} | ${false} | ${noDetails} | ${'Canceled deploy to'} | ${noActions}
+ status | previous | deploymentDetails | text | actionButtons
+ ${CREATED} | ${true} | ${deployDetail} | ${'Can be manually deployed to'} | ${deployGroup}
+ ${CREATED} | ${true} | ${noDetails} | ${'Will deploy to'} | ${deployGroup}
+ ${CREATED} | ${false} | ${deployDetail} | ${'Can be manually deployed to'} | ${noActions}
+ ${CREATED} | ${false} | ${noDetails} | ${'Will deploy to'} | ${noActions}
+ ${RUNNING} | ${true} | ${deployDetail} | ${'Deploying to'} | ${deployGroup}
+ ${RUNNING} | ${true} | ${noDetails} | ${'Deploying to'} | ${deployGroup}
+ ${RUNNING} | ${false} | ${deployDetail} | ${'Deploying to'} | ${noActions}
+ ${RUNNING} | ${false} | ${noDetails} | ${'Deploying to'} | ${noActions}
+ ${SUCCESS} | ${true} | ${deployDetail} | ${'Deployed to'} | ${deployGroup}
+ ${SUCCESS} | ${true} | ${noDetails} | ${'Deployed to'} | ${deployGroup}
+ ${SUCCESS} | ${false} | ${deployDetail} | ${'Deployed to'} | ${deployGroup}
+ ${SUCCESS} | ${false} | ${noDetails} | ${'Deployed to'} | ${deployGroup}
+ ${FAILED} | ${true} | ${deployDetail} | ${'Failed to deploy to'} | ${deployGroup}
+ ${FAILED} | ${true} | ${noDetails} | ${'Failed to deploy to'} | ${deployGroup}
+ ${FAILED} | ${false} | ${deployDetail} | ${'Failed to deploy to'} | ${noActions}
+ ${FAILED} | ${false} | ${noDetails} | ${'Failed to deploy to'} | ${noActions}
+ ${CANCELED} | ${true} | ${deployDetail} | ${'Canceled deployment to'} | ${deployGroup}
+ ${CANCELED} | ${true} | ${noDetails} | ${'Canceled deployment to'} | ${deployGroup}
+ ${CANCELED} | ${false} | ${deployDetail} | ${'Canceled deployment to'} | ${noActions}
+ ${CANCELED} | ${false} | ${noDetails} | ${'Canceled deployment to'} | ${noActions}
`(
'$status + previous: $previous + manual: $deploymentDetails.isManual',
({ status, previous, deploymentDetails, text, actionButtons }) => {
diff --git a/spec/lib/gitlab/bitbucket_server_import/importer_spec.rb b/spec/lib/gitlab/bitbucket_server_import/importer_spec.rb
index 8ab7b2c5fa7..cf39d2cb753 100644
--- a/spec/lib/gitlab/bitbucket_server_import/importer_spec.rb
+++ b/spec/lib/gitlab/bitbucket_server_import/importer_spec.rb
@@ -67,6 +67,7 @@ describe Gitlab::BitbucketServerImport::Importer do
author_email: project.owner.email,
created_at: Time.now,
updated_at: Time.now,
+ raw: {},
merged?: true)
allow(subject.client).to receive(:pull_requests).and_return([pull_request])
@@ -239,6 +240,13 @@ describe Gitlab::BitbucketServerImport::Importer do
expect(notes.first.note).to start_with('*Comment on .gitmodules')
expect(notes.second.note).to start_with('*Comment on .gitmodules')
end
+
+ it 'reports an error if an exception is raised' do
+ allow(subject).to receive(:import_bitbucket_pull_request).and_raise(RuntimeError)
+ expect(Gitlab::ErrorTracking).to receive(:log_exception)
+
+ subject.execute
+ end
end
describe 'inaccessible branches' do
diff --git a/spec/models/project_services/pipelines_email_service_spec.rb b/spec/models/project_services/pipelines_email_service_spec.rb
index 67358d6c3d6..f29414c80c9 100644
--- a/spec/models/project_services/pipelines_email_service_spec.rb
+++ b/spec/models/project_services/pipelines_email_service_spec.rb
@@ -305,8 +305,8 @@ describe PipelinesEmailService, :mailer do
end
context 'with recipients list separating with newlines' do
- let(:recipients) { "\ntest@gitlab.com, \r\nexample@gitlab.com" }
- let(:receivers) { %w[test@gitlab.com example@gitlab.com] }
+ let(:recipients) { "\ntest@gitlab.com, \r\nexample@gitlab.com\rother@gitlab.com" }
+ let(:receivers) { %w[test@gitlab.com example@gitlab.com other@gitlab.com] }
context 'with failed pipeline' do
before do
diff --git a/spec/models/project_spec.rb b/spec/models/project_spec.rb
index c57f47b5738..0b39cfa1243 100644
--- a/spec/models/project_spec.rb
+++ b/spec/models/project_spec.rb
@@ -3992,7 +3992,7 @@ describe Project do
end
it 'schedules HashedStorage::ProjectMigrateWorker with delayed start when the project repo is in use' do
- Gitlab::ReferenceCounter.new(Gitlab::GlRepository::PROJECT.identifier_for_subject(project)).increase
+ Gitlab::ReferenceCounter.new(Gitlab::GlRepository::PROJECT.identifier_for_repositorable(project)).increase
expect(HashedStorage::ProjectMigrateWorker).to receive(:perform_in)
@@ -4000,7 +4000,7 @@ describe Project do
end
it 'schedules HashedStorage::ProjectMigrateWorker with delayed start when the wiki repo is in use' do
- Gitlab::ReferenceCounter.new(Gitlab::GlRepository::WIKI.identifier_for_subject(project)).increase
+ Gitlab::ReferenceCounter.new(Gitlab::GlRepository::WIKI.identifier_for_repositorable(project)).increase
expect(HashedStorage::ProjectMigrateWorker).to receive(:perform_in)
diff --git a/spec/requests/api/internal/base_spec.rb b/spec/requests/api/internal/base_spec.rb
index 12e6e7c7a09..01a5930f8fb 100644
--- a/spec/requests/api/internal/base_spec.rb
+++ b/spec/requests/api/internal/base_spec.rb
@@ -268,7 +268,7 @@ describe API::Internal::Base do
end
context 'with env passed as a JSON' do
- let(:gl_repository) { Gitlab::GlRepository::WIKI.identifier_for_subject(project) }
+ let(:gl_repository) { Gitlab::GlRepository::WIKI.identifier_for_repositorable(project) }
it 'sets env in RequestStore' do
obj_dir_relative = './objects'
@@ -1054,9 +1054,9 @@ describe API::Internal::Base do
def gl_repository_for(project_or_wiki)
case project_or_wiki
when ProjectWiki
- Gitlab::GlRepository::WIKI.identifier_for_subject(project_or_wiki.project)
+ Gitlab::GlRepository::WIKI.identifier_for_repositorable(project_or_wiki.project)
when Project
- Gitlab::GlRepository::PROJECT.identifier_for_subject(project_or_wiki)
+ Gitlab::GlRepository::PROJECT.identifier_for_repositorable(project_or_wiki)
else
nil
end
diff --git a/spec/support/shared_examples/repo_type_shared_examples.rb b/spec/support/shared_examples/repo_type_shared_examples.rb
index dc9e3a73346..e4f277650e5 100644
--- a/spec/support/shared_examples/repo_type_shared_examples.rb
+++ b/spec/support/shared_examples/repo_type_shared_examples.rb
@@ -1,8 +1,8 @@
# frozen_string_literal: true
shared_examples 'a repo type' do
- describe "#identifier_for_subject" do
- subject { described_class.identifier_for_subject(project) }
+ describe "#identifier_for_repositorable" do
+ subject { described_class.identifier_for_repositorable(project) }
it { is_expected.to eq(expected_identifier) }
end