Commit 58edf0cd authored by Alex Buijs's avatar Alex Buijs

Disable invisible captcha by default in tests

Signing up fails in tests when the signup form is submitted
to quick, so disable it by default in tests.
parent 63d389e9
......@@ -3,10 +3,6 @@
require 'spec_helper'
describe RegistrationsController do
before do
stub_feature_flags(invisible_captcha: false)
end
describe '#create' do
context 'when the user opted-in' do
let(:user_params) { { user: attributes_for(:user, email_opted_in: '1') } }
......
......@@ -45,7 +45,6 @@ describe TrialRegistrationsController do
describe '#create' do
before do
stub_feature_flags(invisible_captcha: false)
stub_application_setting(send_user_confirmation_email: true)
end
......
......@@ -5,10 +5,6 @@ require 'spec_helper'
describe 'Signup on EE' do
let(:user_attrs) { attributes_for(:user) }
before do
stub_feature_flags(invisible_captcha: false)
end
context 'for Gitlab.com' do
before do
expect(Gitlab).to receive(:com?).and_return(true).at_least(:once)
......
......@@ -7,7 +7,6 @@ describe 'Trial Sign Up', :js do
describe 'on GitLab.com' do
before do
stub_feature_flags(invisible_captcha: false)
stub_feature_flags(improved_trial_signup: true)
allow(Gitlab).to receive(:com?).and_return(true).at_least(:once)
end
......
......@@ -7,7 +7,6 @@ describe 'Trial Capture Lead', :js do
let(:user) { create(:user) }
before do
stub_feature_flags(invisible_captcha: false)
stub_feature_flags(improved_trial_signup: true)
allow(Gitlab).to receive(:com?).and_return(true).at_least(:once)
sign_in(user)
......
......@@ -9,7 +9,6 @@ describe 'Trial Select Namespace', :js do
let(:user) { create(:user) }
before do
stub_feature_flags(invisible_captcha: false)
stub_feature_flags(improved_trial_signup: true)
allow(Gitlab).to receive(:com?).and_return(true).at_least(:once)
sign_in(user)
......
......@@ -114,9 +114,14 @@ describe RegistrationsController do
context 'when invisible captcha is enabled' do
before do
stub_feature_flags(invisible_captcha: true)
InvisibleCaptcha.timestamp_enabled = true
InvisibleCaptcha.timestamp_threshold = treshold
end
after do
InvisibleCaptcha.timestamp_enabled = false
end
let(:treshold) { 4 }
let(:session_params) { { invisible_captcha_timestamp: form_rendered_time.iso8601 } }
let(:form_rendered_time) { Time.current }
......
......@@ -10,7 +10,6 @@ describe 'Invites' do
let(:group_invite) { group.group_members.invite.last }
before do
stub_feature_flags(invisible_captcha: false)
project.add_maintainer(owner)
group.add_user(owner, Gitlab::Access::OWNER)
group.add_developer('user@example.com', owner)
......
......@@ -5,10 +5,6 @@ require 'spec_helper'
shared_examples 'Signup' do
include TermsHelper
before do
stub_feature_flags(invisible_captcha: false)
end
let(:new_user) { build_stubbed(:user) }
describe 'username validation', :js do
......@@ -396,20 +392,14 @@ describe 'With experimental flow' do
it_behaves_like 'Signup'
describe 'when role is required' do
let(:user) { create(:user) }
before do
it 'redirects to step 2 of the signup process, updates the user, sets the name and role and then redirects to the requested url' do
user = create(:user)
user.set_role_required!
user.reload
sign_in(user)
visit new_project_path
end
it 'is redirected to step 2 of the signup process' do
expect(page).to have_text("Welcome to GitLab.com#{user.username}!")
end
expect(current_path).to eq users_sign_up_welcome_path
it 'updates the user, sets the name and role and redirects to the requested url' do
fill_in 'user_name', with: 'New name'
select 'Software Developer', from: 'user_role'
click_button 'Get started!'
......
......@@ -379,3 +379,6 @@ end
# Prevent Rugged from picking up local developer gitconfig.
Rugged::Settings['search_path_global'] = Rails.root.join('tmp/tests').to_s
# Disable timestamp checks for invisible_captcha
InvisibleCaptcha.timestamp_enabled = false
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment