Better path handling in specs

parent 2bce8172
...@@ -264,7 +264,7 @@ module Backup ...@@ -264,7 +264,7 @@ module Backup
def create_attributes def create_attributes
attrs = { attrs = {
key: remote_target, key: remote_target,
body: File.open(tar_file), body: File.open("#{backup_path}/#{tar_file}"),
multipart_chunk_size: Gitlab.config.backup.upload.multipart_chunk_size, multipart_chunk_size: Gitlab.config.backup.upload.multipart_chunk_size,
encryption: Gitlab.config.backup.upload.encryption, encryption: Gitlab.config.backup.upload.encryption,
encryption_key: Gitlab.config.backup.upload.encryption_key, encryption_key: Gitlab.config.backup.upload.encryption_key,
......
...@@ -329,10 +329,8 @@ describe Backup::Manager do ...@@ -329,10 +329,8 @@ describe Backup::Manager do
.with(hash_including(key: backup_filename, public: false)) .with(hash_including(key: backup_filename, public: false))
.and_return(true) .and_return(true)
Dir.chdir(Gitlab.config.backup.path) do
subject.upload subject.upload
end end
end
it 'adds the DIRECTORY environment variable if present' do it 'adds the DIRECTORY environment variable if present' do
stub_env('DIRECTORY', 'daily') stub_env('DIRECTORY', 'daily')
...@@ -341,11 +339,9 @@ describe Backup::Manager do ...@@ -341,11 +339,9 @@ describe Backup::Manager do
.with(hash_including(key: "daily/#{backup_filename}", public: false)) .with(hash_including(key: "daily/#{backup_filename}", public: false))
.and_return(true) .and_return(true)
Dir.chdir(Gitlab.config.backup.path) do
subject.upload subject.upload
end end
end end
end
context 'with Google provider' do context 'with Google provider' do
before do before do
...@@ -373,10 +369,8 @@ describe Backup::Manager do ...@@ -373,10 +369,8 @@ describe Backup::Manager do
.with(hash_excluding(public: false)) .with(hash_excluding(public: false))
.and_return(true) .and_return(true)
Dir.chdir(Gitlab.config.backup.path) do
subject.upload subject.upload
end end
end 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