diff options
Diffstat (limited to 'spec/helpers/recaptcha_experiment_helper_spec.rb')
-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 |