diff options
Diffstat (limited to 'spec')
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 |