diff options
author | Ash McKenzie <amckenzie@gitlab.com> | 2019-06-25 22:32:54 +0000 |
---|---|---|
committer | Thong Kuah <tkuah@gitlab.com> | 2019-06-25 22:32:54 +0000 |
commit | 15e9aced75319e6e2b48f4b19fcba1346103f772 (patch) | |
tree | 6ff0d9fa36aa2e67e565147fd5105f90fe5a6a11 /spec/helpers | |
parent | 87b468c254e3e1e3b6b1d86e003f1f90a39935a2 (diff) | |
download | gitlab-ce-15e9aced75319e6e2b48f4b19fcba1346103f772.tar.gz |
New RecaptchaExperimentHelper modules
RecaptchaExperimentHelper contains helper methods
to assist in the controller and view layers.
Diffstat (limited to 'spec/helpers')
-rw-r--r-- | spec/helpers/recaptcha_experiment_helper_spec.rb | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/spec/helpers/recaptcha_experiment_helper_spec.rb b/spec/helpers/recaptcha_experiment_helper_spec.rb new file mode 100644 index 00000000000..775c2caa082 --- /dev/null +++ b/spec/helpers/recaptcha_experiment_helper_spec.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true + +require 'spec_helper' + +describe RecaptchaExperimentHelper, type: :helper do + describe '.show_recaptcha_sign_up?' do + context 'when reCAPTCHA is disabled' do + it 'returns false' do + stub_application_setting(recaptcha_enabled: false) + + expect(helper.show_recaptcha_sign_up?).to be(false) + end + end + + context 'when reCAPTCHA is enabled' do + it 'returns true' do + stub_application_setting(recaptcha_enabled: true) + + expect(helper.show_recaptcha_sign_up?).to be(true) + end + end + end +end |