Commit fc01042f authored by Kim "BKC" Carlbäcker's avatar Kim "BKC" Carlbäcker

Add a disable_gitaly flag for specs

parent 7d2a2035
...@@ -26,7 +26,7 @@ describe Projects::UpdateRepositoryStorageService do ...@@ -26,7 +26,7 @@ describe Projects::UpdateRepositoryStorageService do
FileUtils.rm_rf('tmp/tests/storage_b') FileUtils.rm_rf('tmp/tests/storage_b')
end end
context 'without wiki', :skip_gitaly_mock do context 'without wiki', :disable_gitaly do
let(:project) { create(:project, :repository, repository_storage: 'a', repository_read_only: true, wiki_enabled: false) } let(:project) { create(:project, :repository, repository_storage: 'a', repository_read_only: true, wiki_enabled: false) }
context 'when the move succeeds' do context 'when the move succeeds' do
...@@ -60,7 +60,7 @@ describe Projects::UpdateRepositoryStorageService do ...@@ -60,7 +60,7 @@ describe Projects::UpdateRepositoryStorageService do
end end
end end
context 'with wiki', :skip_gitaly_mock do context 'with wiki', :disable_gitaly do
let(:project) { create(:project, :repository, repository_storage: 'a', repository_read_only: true, wiki_enabled: true) } let(:project) { create(:project, :repository, repository_storage: 'a', repository_read_only: true, wiki_enabled: true) }
let(:repository_double) { double(:repository) } let(:repository_double) { double(:repository) }
let(:wiki_repository_double) { double(:repository) } let(:wiki_repository_double) { double(:repository) }
......
RSpec.configure do |config| RSpec.configure do |config|
config.before(:each) do |example| config.before(:each) do |example|
if example.metadata[:skip_gitaly_mock] if example.metadata[:disable_gitaly]
allow(Gitlab::GitalyClient).to receive(:feature_enabled?).and_return(false) allow(Gitlab::GitalyClient).to receive(:feature_enabled?).and_return(false)
else else
next if example.metadata[:skip_gitaly_mock]
allow(Gitlab::GitalyClient).to receive(:feature_enabled?).and_return(true) allow(Gitlab::GitalyClient).to receive(:feature_enabled?).and_return(true)
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