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-03-31 09:07:50 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-03-31 09:07:50 +0300
commit92077e0f8d70c70a908395808b16f98ecd3a5fcd (patch)
treeefb011b2b7e96c2a8a0e7877c0966ab70014ebee /spec
parent83a3209c3f8e5bc055acf80f3440335d2b97133b (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec')
-rw-r--r--spec/controllers/repositories/git_http_controller_spec.rb6
-rw-r--r--spec/javascripts/dirty_submit/dirty_submit_form_spec.js1
-rw-r--r--spec/lib/gitlab/cleanup/orphan_job_artifact_files_spec.rb6
-rw-r--r--spec/models/concerns/prometheus_adapter_spec.rb1
-rw-r--r--spec/services/spam/spam_check_service_spec.rb6
5 files changed, 16 insertions, 4 deletions
diff --git a/spec/controllers/repositories/git_http_controller_spec.rb b/spec/controllers/repositories/git_http_controller_spec.rb
index 005db748e91..0bd2305ff85 100644
--- a/spec/controllers/repositories/git_http_controller_spec.rb
+++ b/spec/controllers/repositories/git_http_controller_spec.rb
@@ -146,9 +146,12 @@ describe Repositories::GitHttpController do
let(:params) { container_params.merge(service: 'git-upload-pack') }
it 'returns 404' do
+ expect(controller).not_to receive(:access_check)
+
get :info_refs, params: params
expect(response).to have_gitlab_http_status(:not_found)
+ expect(response.body).to eq "The project you were looking for could not be found."
end
end
@@ -160,9 +163,12 @@ describe Repositories::GitHttpController do
end
it 'returns 404' do
+ expect(controller).not_to receive(:access_check)
+
post :git_upload_pack, params: params
expect(response).to have_gitlab_http_status(:not_found)
+ expect(response.body).to eq "The project you were looking for could not be found."
end
end
end
diff --git a/spec/javascripts/dirty_submit/dirty_submit_form_spec.js b/spec/javascripts/dirty_submit/dirty_submit_form_spec.js
index 2907d038390..42f806fa1bf 100644
--- a/spec/javascripts/dirty_submit/dirty_submit_form_spec.js
+++ b/spec/javascripts/dirty_submit/dirty_submit_form_spec.js
@@ -70,6 +70,7 @@ describe('DirtySubmitForm', () => {
describe('throttling tests', () => {
beforeEach(() => {
jasmine.clock().install();
+ jasmine.clock().mockDate();
DirtySubmitForm.THROTTLE_DURATION = 100;
});
diff --git a/spec/lib/gitlab/cleanup/orphan_job_artifact_files_spec.rb b/spec/lib/gitlab/cleanup/orphan_job_artifact_files_spec.rb
index 75ef75fccc9..966c4c8b2fb 100644
--- a/spec/lib/gitlab/cleanup/orphan_job_artifact_files_spec.rb
+++ b/spec/lib/gitlab/cleanup/orphan_job_artifact_files_spec.rb
@@ -28,6 +28,12 @@ describe Gitlab::Cleanup::OrphanJobArtifactFiles do
expect { cleanup.run! }.to raise_error('Invalid niceness')
end
+ it 'passes correct arguments to ionice' do
+ allow(Gitlab::Utils).to receive(:which).with('ionice').and_return('/fake/ionice')
+ expect(Open3).to receive(:popen3).with('/fake/ionice', '-c', any_args)
+ cleanup.run!
+ end
+
it 'finds artifacts on disk' do
artifact = create(:ci_job_artifact, :archive)
diff --git a/spec/models/concerns/prometheus_adapter_spec.rb b/spec/models/concerns/prometheus_adapter_spec.rb
index 3ac96b308ed..bc58df7e7c2 100644
--- a/spec/models/concerns/prometheus_adapter_spec.rb
+++ b/spec/models/concerns/prometheus_adapter_spec.rb
@@ -131,7 +131,6 @@ describe PrometheusAdapter, :use_clean_rails_memory_store_caching do
end
it { expect(subject.to_json).to eq(prometheus_data.to_json) }
- it { expect(subject.to_json).to eq(prometheus_data.to_json) }
end
[404, 500].each do |status|
diff --git a/spec/services/spam/spam_check_service_spec.rb b/spec/services/spam/spam_check_service_spec.rb
index cb13465b825..3ebde2a92c6 100644
--- a/spec/services/spam/spam_check_service_spec.rb
+++ b/spec/services/spam/spam_check_service_spec.rb
@@ -49,7 +49,7 @@ describe Spam::SpamCheckService do
end
end
- shared_examples 'akismet spam' do
+ shared_examples 'only checks for spam if a request is provided' do
context 'when request is missing' do
let(:request) { nil }
@@ -132,7 +132,7 @@ describe Spam::SpamCheckService do
stub_feature_flags(allow_possible_spam: false)
end
- it_behaves_like 'akismet spam'
+ it_behaves_like 'only checks for spam if a request is provided'
it 'marks as spam' do
subject
@@ -142,7 +142,7 @@ describe Spam::SpamCheckService do
end
context 'when allow_possible_spam feature flag is true' do
- it_behaves_like 'akismet spam'
+ it_behaves_like 'only checks for spam if a request is provided'
it 'does not mark as spam' do
subject