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

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

module TermsHelper
  def enforce_terms
    stub_env('IN_MEMORY_APPLICATION_SETTINGS', 'false')
    settings = Gitlab::CurrentSettings.current_application_settings
    ApplicationSettings::UpdateService.new(
      settings, nil, terms: 'These are the terms', enforce_terms: true
    ).execute
  end

  def accept_terms(user)
    terms = Gitlab::CurrentSettings.current_application_settings.latest_terms
    Users::RespondToTermsService.new(user, terms).execute(accepted: true)
  end

  def expect_to_be_on_terms_page
    expect(page).to have_current_path terms_path, ignore_query: true
    expect(page).to have_content('Please accept the Terms of Service before continuing.')
  end
end

TermsHelper.prepend_mod