summaryrefslogtreecommitdiff
path: root/doc/development/feature_flags.md
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 /doc/development/feature_flags.md
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 'doc/development/feature_flags.md')
-rw-r--r--doc/development/feature_flags.md12
1 files changed, 12 insertions, 0 deletions
diff --git a/doc/development/feature_flags.md b/doc/development/feature_flags.md
index 09ea8c05be6..702caacc74f 100644
--- a/doc/development/feature_flags.md
+++ b/doc/development/feature_flags.md
@@ -57,3 +57,15 @@ end
Features that are developed and are intended to be merged behind a feature flag
should not include a changelog entry. The entry should be added in the merge
request removing the feature flags.
+
+### Specs
+
+In the test environment `Feature.enabled?` is stubbed to always respond to `true`,
+so we make sure behavior under feature flag doesn't go untested in some non-specific
+contexts.
+
+If you need to test the feature flag in a different state, you need to stub it with:
+
+```ruby
+stub_feature_flags(my_feature_flag: false)
+```