summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorMicaël Bergeron <mbergeron@gitlab.com>2018-02-22 10:46:13 -0500
committerMicaël Bergeron <mbergeron@gitlab.com>2018-03-01 10:36:56 -0500
commit5cf1cc6a0fe1a60cf51bc44535df8cc17d10b3a0 (patch)
treeaffb51535b5184d4bc04ccd70dedfc89ee83904f /spec
parent50c08d0eda6a1863e025b09c20dc2e4a38754ff4 (diff)
downloadgitlab-ce-5cf1cc6a0fe1a60cf51bc44535df8cc17d10b3a0.tar.gz
remove the license check
Diffstat (limited to 'spec')
-rw-r--r--spec/requests/lfs_http_spec.rb42
-rw-r--r--spec/support/stub_object_storage.rb4
-rw-r--r--spec/uploaders/lfs_object_uploader_spec.rb22
3 files changed, 1 insertions, 67 deletions
diff --git a/spec/requests/lfs_http_spec.rb b/spec/requests/lfs_http_spec.rb
index da7dd936a76..0ddbddb112c 100644
--- a/spec/requests/lfs_http_spec.rb
+++ b/spec/requests/lfs_http_spec.rb
@@ -683,34 +683,6 @@ describe 'Git LFS API and storage' do
expect(json_response['objects'].first['actions']['upload']['href']).to eq("#{Gitlab.config.gitlab.url}/#{project.full_path}.git/gitlab-lfs/objects/#{sample_oid}/#{sample_size}")
expect(json_response['objects'].first['actions']['upload']['header']).to eq('Authorization' => authorization)
end
-
- ## EE-specific context
- context 'and project is above the limit' do
- let(:update_lfs_permissions) do
- allow_any_instance_of(EE::Project).to receive_messages(
- repository_and_lfs_size: 100.megabytes,
- actual_size_limit: 99.megabytes)
- end
-
- it 'responds with status 406' do
- expect(response).to have_gitlab_http_status(406)
- expect(json_response['message']).to eql('Your push has been rejected, because this repository has exceeded its size limit of 99 MB by 1 MB. Please contact your GitLab administrator for more information.')
- end
- end
-
- context 'and project will go over the limit' do
- let(:update_lfs_permissions) do
- allow_any_instance_of(EE::Project).to receive_messages(
- repository_and_lfs_size: 200.megabytes,
- actual_size_limit: 300.megabytes)
- end
-
- it 'responds with status 406' do
- expect(response).to have_gitlab_http_status(406)
- expect(json_response['documentation_url']).to include('/help')
- expect(json_response['message']).to eql('Your push has been rejected, because this repository has exceeded its size limit of 300 MB by 50 MB. Please contact your GitLab administrator for more information.')
- end
- end
end
describe 'when request is authenticated' do
@@ -1049,20 +1021,6 @@ describe 'Git LFS API and storage' do
end
end
- context 'and project has limit enabled but will stay under the limit' do
- before do
- allow_any_instance_of(EE::Project).to receive_messages(
- actual_size_limit: 200,
- size_limit_enabled?: true)
-
- put_finalize
- end
-
- it 'responds with status 200' do
- expect(response).to have_gitlab_http_status(200)
- end
- end
-
context 'invalid tempfiles' do
it 'rejects slashes in the tempfile name (path traversal' do
put_finalize('foo/bar')
diff --git a/spec/support/stub_object_storage.rb b/spec/support/stub_object_storage.rb
index 93477e513f2..69c59fb0015 100644
--- a/spec/support/stub_object_storage.rb
+++ b/spec/support/stub_object_storage.rb
@@ -1,12 +1,10 @@
module StubConfiguration
- def stub_object_storage_uploader(config:, uploader:, remote_directory:, enabled: true, licensed: true, background_upload: false)
+ def stub_object_storage_uploader(config:, uploader:, remote_directory:, enabled: true, background_upload: false)
Fog.mock!
allow(config).to receive(:enabled) { enabled }
allow(config).to receive(:background_upload) { background_upload }
- stub_licensed_features(object_storage: licensed) unless licensed == :skip
-
return unless enabled
::Fog::Storage.new(uploader.object_store_credentials).tap do |connection|
diff --git a/spec/uploaders/lfs_object_uploader_spec.rb b/spec/uploaders/lfs_object_uploader_spec.rb
index fbb4a188646..a2fb3886610 100644
--- a/spec/uploaders/lfs_object_uploader_spec.rb
+++ b/spec/uploaders/lfs_object_uploader_spec.rb
@@ -43,18 +43,6 @@ describe LfsObjectUploader do
lfs_object
end
end
-
- context 'with object storage unlicenced' do
- before do
- stub_lfs_object_storage(licensed: false)
- end
-
- it 'is skipped' do
- expect(ObjectStorage::BackgroundMoveWorker).not_to receive(:perform_async)
-
- lfs_object
- end
- end
end
describe 'remote file' do
@@ -75,16 +63,6 @@ describe LfsObjectUploader do
expect(lfs_object.file.path).not_to be_blank
end
end
-
- context 'with object storage unlicenced' do
- before do
- stub_lfs_object_storage(licensed: false)
- end
-
- it 'can not store file remotely' do
- expect { store_file(lfs_object) }.to raise_error('Object Storage feature is missing')
- end
- end
end
def store_file(lfs_object)