Skip to content
Snippets Groups Projects
Commit d5ccef68 authored by Jan Provaznik's avatar Jan Provaznik
Browse files

Merge branch 'sy-221-text-injection-with-signup-onboarding' into 'master'

Validate email on the almost there page

See merge request !103921



Merged-by: Jan Provaznik's avatarJan Provaznik <jprovaznik@gitlab.com>
Approved-by: default avatarDaniel Mora <dmora@gitlab.com>
Approved-by: Jan Provaznik's avatarJan Provaznik <jprovaznik@gitlab.com>
Co-authored-by: default avatarsyarynovskyi <syarynovskyi@gitlab.com>
parents 721d8b0b 172430f7
No related branches found
No related tags found
1 merge request!103921Validate email on the almost there page
Pipeline #696631846 passed
- user_email = "(#{params[:email]})" if params[:email].present?
- user_email = "(#{params[:email]})" if Devise.email_regexp.match?(params[:email])
- request_link_start = '<a href="%{new_user_confirmation_path}">'.html_safe % { new_user_confirmation_path: new_user_confirmation_path }
- request_link_end = '</a>'.html_safe
- content_for :page_specific_javascripts do
......
# frozen_string_literal: true
require 'spec_helper'
RSpec.describe 'devise/confirmations/almost_there' do
describe 'confirmations text' do
subject { render(template: 'devise/confirmations/almost_there') }
before do
allow(view).to receive(:params).and_return(email: email)
end
context 'when correct email' do
let(:email) { 'こんにちは@test' }
specify do
subject
expect(rendered).to have_content(
"Please check your email (#{email}) to confirm your account"
)
end
end
context 'when random text' do
let(:email) { 'random text' }
specify do
subject
expect(rendered).to have_content(
'Please check your email to confirm your account'
)
end
end
end
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment