debian-mirror-gitlab/spec/support/helpers/terms_helper.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

24 lines
741 B
Ruby
Raw Permalink Normal View History

2019-10-12 21:52:04 +05:30
# frozen_string_literal: true
2018-10-15 14:42:47 +05:30
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
2022-05-07 20:08:51 +05:30
expect(page).to have_current_path terms_path, ignore_query: true
2018-10-15 14:42:47 +05:30
expect(page).to have_content('Please accept the Terms of Service before continuing.')
end
end
2022-05-07 20:08:51 +05:30
TermsHelper.prepend_mod