summaryrefslogtreecommitdiff
path: root/spec/controllers/registrations_controller_spec.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-12-16 12:08:27 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2022-12-16 12:08:27 +0000
commit377d420e3d7e3f066c409714cbb9f7bb0a4882b6 (patch)
tree4ba0cb1b9487bf386c3c0e5d76a2191f285b6243 /spec/controllers/registrations_controller_spec.rb
parentbc9b43904d491c7b864c8fb6ba06ae0f6625db0d (diff)
downloadgitlab-ce-377d420e3d7e3f066c409714cbb9f7bb0a4882b6.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/controllers/registrations_controller_spec.rb')
-rw-r--r--spec/controllers/registrations_controller_spec.rb20
1 files changed, 20 insertions, 0 deletions
diff --git a/spec/controllers/registrations_controller_spec.rb b/spec/controllers/registrations_controller_spec.rb
index 0770f34d9de..699052fe37a 100644
--- a/spec/controllers/registrations_controller_spec.rb
+++ b/spec/controllers/registrations_controller_spec.rb
@@ -167,6 +167,16 @@ RSpec.describe RegistrationsController do
expect(controller.current_user).to be_nil
end
+ it 'tracks an almost there redirect' do
+ post_create
+
+ expect_snowplow_event(
+ category: described_class.name,
+ action: 'render',
+ user: User.find_by(email: base_user_params[:email])
+ )
+ end
+
context 'when registration is triggered from an accepted invite' do
context 'when it is part from the initial invite email', :snowplow do
let_it_be(:member) { create(:project_member, :invited, invite_email: user_params.dig(:user, :email)) }
@@ -260,6 +270,16 @@ RSpec.describe RegistrationsController do
expect(response).to redirect_to(users_sign_up_welcome_path)
end
+ it 'does not track an almost there redirect' do
+ post_create
+
+ expect_no_snowplow_event(
+ category: described_class.name,
+ action: 'render',
+ user: User.find_by(email: base_user_params[:email])
+ )
+ end
+
context 'when invite email matches email used on registration' do
let(:session_params) { { invite_email: user_params.dig(:user, :email) } }