summaryrefslogtreecommitdiff
path: root/spec/services
diff options
context:
space:
mode:
authorGabriel Mazetto <brodock@gmail.com>2018-08-20 20:52:56 +0200
committerGabriel Mazetto <brodock@gmail.com>2018-08-22 05:41:15 +0200
commit61c35b6ca1840507f5da3aa4d951e4273e612d66 (patch)
tree7c248fec944fd3a4604086ec8ccfaf313c85f0a1 /spec/services
parenta440c2be018e79ee671543c2c96cc1f741336fde (diff)
downloadgitlab-ce-61c35b6ca1840507f5da3aa4d951e4273e612d66.tar.gz
Fixed `stub_feature_flag behavior` for `disabled?` flags.
Previous code would not work with `disabled?` because that method would send two parameters (second always `nil`) which we are not mocking. Instead of mock yet another state, I decide to fix it where it belongs.
Diffstat (limited to 'spec/services')
-rw-r--r--spec/services/projects/update_service_spec.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/spec/services/projects/update_service_spec.rb b/spec/services/projects/update_service_spec.rb
index 2409be80cec..bc8bda1000e 100644
--- a/spec/services/projects/update_service_spec.rb
+++ b/spec/services/projects/update_service_spec.rb
@@ -262,6 +262,7 @@ describe Projects::UpdateService do
context 'when hashed storage is enabled' do
before do
stub_application_setting(hashed_storage_enabled: true)
+ stub_feature_flags(disable_hashed_storage_upgrade: false)
end
it 'migrates project to a hashed storage instead of renaming the repo to another legacy name' do
@@ -275,7 +276,7 @@ describe Projects::UpdateService do
context 'when disable_hashed_storage_upgrade feature flag is enabled' do
before do
- expect(Feature).to receive(:enabled?).with(:disable_hashed_storage_upgrade) { true }
+ stub_feature_flags(disable_hashed_storage_upgrade: true)
end
it 'renames the project without upgrading it' do