Commit 8eed7851 authored by Bob Van Landuyt's avatar Bob Van Landuyt

Stub storage configuration using a helper

parent d7fa3443
require 'spec_helper' require 'spec_helper'
describe Projects::UpdateRepositoryStorageService do describe Projects::UpdateRepositoryStorageService do
include StubConfiguration
subject { described_class.new(project) } subject { described_class.new(project) }
describe "#execute" do describe "#execute" do
...@@ -15,7 +17,7 @@ describe Projects::UpdateRepositoryStorageService do ...@@ -15,7 +17,7 @@ describe Projects::UpdateRepositoryStorageService do
'a' => { 'path' => 'tmp/tests/storage_a' }, 'a' => { 'path' => 'tmp/tests/storage_a' },
'b' => { 'path' => 'tmp/tests/storage_b' } 'b' => { 'path' => 'tmp/tests/storage_b' }
} }
allow(Gitlab.config.repositories).to receive(:storages).and_return(storages) stub_storage_settings(storages)
allow(subject).to receive(:gitlab_shell).and_return(gitlab_shell) allow(subject).to receive(:gitlab_shell).and_return(gitlab_shell)
allow(Time).to receive(:now).and_return(time) allow(Time).to receive(:now).and_return(time)
......
require 'spec_helper' require 'spec_helper'
describe Projects::UpdateService, '#execute' do describe Projects::UpdateService, '#execute' do
include StubConfiguration
let(:user) { create(:user) } let(:user) { create(:user) }
let(:admin) { create(:admin) } let(:admin) { create(:admin) }
...@@ -148,7 +150,7 @@ describe Projects::UpdateService, '#execute' do ...@@ -148,7 +150,7 @@ describe Projects::UpdateService, '#execute' do
'a' => { 'path' => 'tmp/tests/storage_a' }, 'a' => { 'path' => 'tmp/tests/storage_a' },
'b' => { 'path' => 'tmp/tests/storage_b' } 'b' => { 'path' => 'tmp/tests/storage_b' }
} }
allow(Gitlab.config.repositories).to receive(:storages).and_return(storages) stub_storage_settings(storages)
end end
after do after do
......
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