summaryrefslogtreecommitdiff
path: root/spec/config
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2018-07-23 17:33:06 +0300
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2018-07-24 14:44:44 +0300
commitedf1c1fccf156b8789814be80f3a17b57afd38d1 (patch)
tree2de1d3824f0c67c8e6ba4bec0d35c843ab49bb4e /spec/config
parenta3f1592b898ce01bcf516ba0d16a4606868c2743 (diff)
downloadgitlab-ce-edf1c1fccf156b8789814be80f3a17b57afd38d1.tar.gz
Make ObjectStoreSettings use more explicit and add specsdz-refactor-object-store-settings
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Diffstat (limited to 'spec/config')
-rw-r--r--spec/config/object_store_settings_spec.rb29
1 files changed, 29 insertions, 0 deletions
diff --git a/spec/config/object_store_settings_spec.rb b/spec/config/object_store_settings_spec.rb
new file mode 100644
index 00000000000..b1ada3c99db
--- /dev/null
+++ b/spec/config/object_store_settings_spec.rb
@@ -0,0 +1,29 @@
+require 'spec_helper'
+require Rails.root.join('config', 'object_store_settings.rb')
+
+describe ObjectStoreSettings do
+ describe '.parse' do
+ it 'should set correct default values' do
+ settings = described_class.parse(nil)
+
+ expect(settings['enabled']).to be false
+ expect(settings['direct_upload']).to be false
+ expect(settings['background_upload']).to be true
+ expect(settings['remote_directory']).to be nil
+ end
+
+ it 'respects original values' do
+ original_settings = Settingslogic.new({
+ 'enabled' => true,
+ 'remote_directory' => 'artifacts'
+ })
+
+ settings = described_class.parse(original_settings)
+
+ expect(settings['enabled']).to be true
+ expect(settings['direct_upload']).to be false
+ expect(settings['background_upload']).to be true
+ expect(settings['remote_directory']).to eq 'artifacts'
+ end
+ end
+end