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
Settings.artifacts['object_store']['remote_directory'] ||= nil
# Convert upload connection settings to use symbol keys, to make Fog happy
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
#
......
......@@ -75,7 +75,7 @@ feature 'Geo clone instructions', feature: true, js: true do
when 'ssh'
project.ssh_url_to_repo
when 'http'
project.http_url_to_repo(developer)
project.http_url_to_repo
end
end
end
......@@ -14,11 +14,13 @@ module StubConfiguration
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|
begin
connection.directories.create(key: 'artifacts')
rescue Excon::Error::Conflict
end
end if enabled
end
end
end
......@@ -95,13 +95,10 @@ describe ObjectStoreUploader do
context 'when migrating to remote storage' do
let(:new_store) { described_class::REMOTE_STORE }
before do
@current_path = uploader.path
end
let!(current_path) { uploader.path }
it "file does exist" do
expect(File.exist?(@current_path)).to eq(true)
expect(File.exist?(current_path)).to eq(true)
end
context 'when storage is disabled' do
......@@ -123,13 +120,13 @@ describe ObjectStoreUploader do
subject
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
it "does delete original file" do
subject
expect(File.exist?(@current_path)).to eq(false)
expect(File.exist?(current_path)).to eq(false)
end
context 'when subject save fails' do
......@@ -147,7 +144,7 @@ describe ObjectStoreUploader do
rescue
end
expect(File.exist?(@current_path)).to eq(true)
expect(File.exist?(current_path)).to eq(true)
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