Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-05-05 21:10:31 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2021-05-05 21:10:31 +0300
commit8f4d63426a207611f71bc19dae62eb19765a4cf2 (patch)
treeb5843aaef889b0d1305e669404693f11ce414d22 /spec/controllers/registrations
parentcf05fd7f3956f0b1a17caf313e89bb7b3315d947 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/controllers/registrations')
-rw-r--r--spec/controllers/registrations/welcome_controller_spec.rb24
1 files changed, 24 insertions, 0 deletions
diff --git a/spec/controllers/registrations/welcome_controller_spec.rb b/spec/controllers/registrations/welcome_controller_spec.rb
index 008259a8bfa..6d34b56df09 100644
--- a/spec/controllers/registrations/welcome_controller_spec.rb
+++ b/spec/controllers/registrations/welcome_controller_spec.rb
@@ -77,6 +77,30 @@ RSpec.describe Registrations::WelcomeController do
it { is_expected.to redirect_to(dashboard_projects_path)}
+ context 'when the new user already has any accepted group membership' do
+ let!(:member1) { create(:group_member, user: user) }
+
+ it 'redirects to the group activity page' do
+ expect(subject).to redirect_to(activity_group_path(member1.source))
+ end
+
+ context 'when the new user already has more than 1 accepted group membership' do
+ it 'redirects to the most recent membership group activty page' do
+ member2 = create(:group_member, user: user)
+
+ expect(subject).to redirect_to(activity_group_path(member2.source))
+ end
+ end
+
+ context 'when the member has an orphaned source at the time of the welcome' do
+ it 'redirects to the project dashboard page' do
+ member1.source.delete
+
+ expect(subject).to redirect_to(dashboard_projects_path)
+ end
+ end
+ end
+
context 'when the user opted in' do
let(:email_opted_in) { '1' }