-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[bug fix] Cannot change account email from user settings (#1403)
Addresses: #1375 Demo: https://user-images.githubusercontent.com/50227291/216375346-430563ab-382e-4c21-a1f5-2aca95f6e4b2.mov Co-authored-by: Pralish Kayastha <[email protected]>
- Loading branch information
1 parent
a1c806e
commit 567bcf8
Showing
6 changed files
with
43 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
- if Subdomain.current.logo.attached? | ||
= link_to root_url(subdomain: Subdomain.current.name), target: '_blank', class: 'd-flex justify-content-center align-items-center' do | ||
- path = rails_blob_url(Subdomain.current.logo, subdomain: Subdomain.current.name == Subdomain::ROOT_DOMAIN_NAME ? 'www' : Subdomain.current.name) | ||
- path = rails_blob_url(Subdomain.current.logo, subdomain: Subdomain.current.subdomain_name) | ||
= image_tag(path, class: 'd-none d-lg-block img-fluid p-4', size: '150x150') | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -394,4 +394,28 @@ class Users::RegistrationsControllerTest < ActionDispatch::IntegrationTest | |
get edit_user_registration_path | ||
assert_nil session[:otp_user_id] | ||
end | ||
|
||
test '#update email: should send confirmation email with correct confirmation url' do | ||
payload = { | ||
user: { | ||
email: '[email protected]', | ||
current_password: '123456' | ||
} | ||
} | ||
assert_changes "Devise.mailer.deliveries.size", +1 do | ||
sign_in(@user) | ||
patch user_registration_url, params: payload | ||
end | ||
|
||
assert_includes Devise.mailer.deliveries.last.body.to_s, "http://public.localhost/users/confirmation?confirmation_token=#{@user.reload.confirmation_token}" | ||
|
||
Subdomain.current.update(name: 'root') | ||
|
||
assert_changes "Devise.mailer.deliveries.size", +1 do | ||
sign_in(@user) | ||
patch user_registration_url, params: payload | ||
end | ||
|
||
assert_includes Devise.mailer.deliveries.last.body.to_s, "http://www.localhost/users/confirmation?confirmation_token=#{@user.reload.confirmation_token}" | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters