diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-08-20 21:42:06 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-08-20 21:42:06 +0300 |
commit | 6e4e1050d9dba2b7b2523fdd1768823ab85feef4 (patch) | |
tree | 78be5963ec075d80116a932011d695dd33910b4e /spec/controllers/sessions_controller_spec.rb | |
parent | 1ce776de4ae122aba3f349c02c17cebeaa8ecf07 (diff) |
Add latest changes from gitlab-org/gitlab@13-3-stable-ee
Diffstat (limited to 'spec/controllers/sessions_controller_spec.rb')
-rw-r--r-- | spec/controllers/sessions_controller_spec.rb | 39 |
1 files changed, 3 insertions, 36 deletions
diff --git a/spec/controllers/sessions_controller_spec.rb b/spec/controllers/sessions_controller_spec.rb index 16a58112479..257dcce0899 100644 --- a/spec/controllers/sessions_controller_spec.rb +++ b/spec/controllers/sessions_controller_spec.rb @@ -59,39 +59,6 @@ RSpec.describe SessionsController do end end end - - describe 'tracking data' do - context 'when the user is part of the experimental group' do - before do - stub_experiment_for_user(signup_flow: true) - end - - it 'doesn\'t pass tracking parameters to the frontend' do - get(:new) - expect(Gon.tracking_data).to be_nil - end - end - - context 'with the experimental signup flow enabled and the user is part of the control group' do - before do - stub_experiment(signup_flow: true) - stub_experiment_for_user(signup_flow: false) - allow_any_instance_of(described_class).to receive(:experimentation_subject_id).and_return('uuid') - end - - it 'passes the right tracking parameters to the frontend' do - get(:new) - expect(Gon.tracking_data).to eq( - { - category: 'Growth::Acquisition::Experiment::SignUpFlow', - action: 'start', - label: 'uuid', - property: 'control_group' - } - ) - end - end - end end describe '#create' do @@ -216,7 +183,7 @@ RSpec.describe SessionsController do before do stub_application_setting(recaptcha_enabled: true) - request.headers[described_class::CAPTCHA_HEADER] = 1 + request.headers[described_class::CAPTCHA_HEADER] = '1' end it 'displays an error when the reCAPTCHA is not solved' do @@ -399,7 +366,7 @@ RSpec.describe SessionsController do end it 'warns about invalid login' do - expect(response).to set_flash.now[:alert].to /Your account is locked./ + expect(flash[:alert]).to eq('Your account is locked.') end it 'locks the user' do @@ -409,7 +376,7 @@ RSpec.describe SessionsController do it 'keeps the user locked on future login attempts' do post(:create, params: { user: { login: user.username, password: user.password } }) - expect(response).to set_flash.now[:alert].to /Your account is locked./ + expect(flash[:alert]).to eq('Your account is locked.') end end end |