Commit 86c8e69a authored by Dmytro Zaporozhets (DZ)'s avatar Dmytro Zaporozhets (DZ)

Merge branch 'ph/338022/fixInviteEmailCase' into 'master'

Fixes email invites being case senstive

See merge request gitlab-org/gitlab!73079
parents c882f0b3 f2918f64
......@@ -52,7 +52,7 @@ class InvitesController < ApplicationController
end
def current_user_matches_invite?
current_user.verified_emails.include?(@member.invite_email)
current_user.verified_email?(@member.invite_email)
end
def member?
......
......@@ -103,6 +103,20 @@ RSpec.describe 'Group or Project invitations', :aggregate_failures do
expect(page).to have_content('You are already a member of this group.')
end
end
context 'when email case doesnt match', :js do
let(:invite_email) { 'User@example.com' }
let(:user) { create(:user, email: 'user@example.com') }
before do
sign_in(user)
visit invite_path(group_invite.raw_invite_token)
end
it 'accepts invite' do
expect(page).to have_content('You have been granted Developer access to group Owned.')
end
end
end
context 'when declining the invitation from invitation reminder email' do
......
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