diff options
author | Mayra Cabrera <mcabrera@gitlab.com> | 2018-05-08 23:33:12 +0300 |
---|---|---|
committer | Mayra Cabrera <mcabrera@gitlab.com> | 2018-05-08 23:33:12 +0300 |
commit | c92f1d893cc5f114ec1e00251b3d1dcec78fab28 (patch) | |
tree | 8935a699fba25feb3ce0672acacf89c4e7836e2e /spec/support/helpers/terms_helper.rb | |
parent | 4babf79aa1e8e2ec315f31fba0d3646825322d91 (diff) | |
parent | d122279fb0a28f248e6cdba339cb1bcd96a91477 (diff) |
Merge branch '10-8-stable-prepare-rc4' into '10-8-stable'
Prepare 10.8 RC4 release
See merge request gitlab-org/gitlab-ce!18784
Diffstat (limited to 'spec/support/helpers/terms_helper.rb')
-rw-r--r-- | spec/support/helpers/terms_helper.rb | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/spec/support/helpers/terms_helper.rb b/spec/support/helpers/terms_helper.rb new file mode 100644 index 00000000000..a00ec14138b --- /dev/null +++ b/spec/support/helpers/terms_helper.rb @@ -0,0 +1,19 @@ +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(current_path).to eq terms_path + expect(page).to have_content('Please accept the Terms of Service before continuing.') + end +end |