Commit 8aa22e8b authored by Kamil Trzcinski's avatar Kamil Trzcinski

Fix failing spec

parent 4032fe12
...@@ -316,7 +316,7 @@ Settings.artifacts['object_store']['enabled'] = false if Settings.artifacts['obj ...@@ -316,7 +316,7 @@ Settings.artifacts['object_store']['enabled'] = false if Settings.artifacts['obj
Settings.artifacts['object_store']['remote_directory'] ||= nil Settings.artifacts['object_store']['remote_directory'] ||= nil
# Convert upload connection settings to use symbol keys, to make Fog happy # Convert upload connection settings to use symbol keys, to make Fog happy
if Settings.artifacts['object_store']['connection'] if Settings.artifacts['object_store']['connection']
Settings.artifacts['object_store']['connection'] = Hash[Settings.artifacts['object_store']['connection'].map { |k, v| [k.to_sym, v] }] Settings.artifacts['object_store']['connection'].deep_symbolize_keys!
end end
# #
......
...@@ -75,7 +75,7 @@ feature 'Geo clone instructions', feature: true, js: true do ...@@ -75,7 +75,7 @@ feature 'Geo clone instructions', feature: true, js: true do
when 'ssh' when 'ssh'
project.ssh_url_to_repo project.ssh_url_to_repo
when 'http' when 'http'
project.http_url_to_repo(developer) project.http_url_to_repo
end end
end end
end end
...@@ -14,11 +14,13 @@ module StubConfiguration ...@@ -14,11 +14,13 @@ module StubConfiguration
allow_any_instance_of(ArtifactUploader).to receive(:verify_license!) { true } allow_any_instance_of(ArtifactUploader).to receive(:verify_license!) { true }
return unless enabled
::Fog::Storage.new(Gitlab.config.artifacts.object_store.connection).tap do |connection| ::Fog::Storage.new(Gitlab.config.artifacts.object_store.connection).tap do |connection|
begin begin
connection.directories.create(key: 'artifacts') connection.directories.create(key: 'artifacts')
rescue Excon::Error::Conflict rescue Excon::Error::Conflict
end end
end if enabled end
end end
end end
...@@ -95,13 +95,10 @@ describe ObjectStoreUploader do ...@@ -95,13 +95,10 @@ describe ObjectStoreUploader do
context 'when migrating to remote storage' do context 'when migrating to remote storage' do
let(:new_store) { described_class::REMOTE_STORE } let(:new_store) { described_class::REMOTE_STORE }
let!(current_path) { uploader.path }
before do
@current_path = uploader.path
end
it "file does exist" do it "file does exist" do
expect(File.exist?(@current_path)).to eq(true) expect(File.exist?(current_path)).to eq(true)
end end
context 'when storage is disabled' do context 'when storage is disabled' do
...@@ -123,13 +120,13 @@ describe ObjectStoreUploader do ...@@ -123,13 +120,13 @@ describe ObjectStoreUploader do
subject subject
expect(uploader.object_store).to eq(new_store) expect(uploader.object_store).to eq(new_store)
expect(File.exist?(@current_path)).to eq(false) expect(File.exist?(current_path)).to eq(false)
end end
it "does delete original file" do it "does delete original file" do
subject subject
expect(File.exist?(@current_path)).to eq(false) expect(File.exist?(current_path)).to eq(false)
end end
context 'when subject save fails' do context 'when subject save fails' do
...@@ -147,7 +144,7 @@ describe ObjectStoreUploader do ...@@ -147,7 +144,7 @@ describe ObjectStoreUploader do
rescue rescue
end end
expect(File.exist?(@current_path)).to eq(true) expect(File.exist?(current_path)).to eq(true)
end end
end end
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment