Welcome to mirror list, hosted at ThFree Co, Russian Federation.

recaptcha_helper_spec.rb « helpers « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: e7f9ba5b73a65bc5f6113572cea5b7e2136560e6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# frozen_string_literal: true

require 'spec_helper'

RSpec.describe RecaptchaHelper, type: :helper do
  let(:session) { {} }

  before do
    allow(helper).to receive(:session) { session }
  end

  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