From ccb607b2eb1c45eab9948a6ef78707f9d2193f5d Mon Sep 17 00:00:00 2001 From: Federico Aloi Date: Wed, 10 Mar 2021 16:47:38 -0300 Subject: [PATCH 01/10] Add delete account section --- app/controllers/users_controller.rb | 3 ++ app/views/users/_user_delete_account.html.erb | 19 ++++++++ app/views/users/_user_delete_modal.html.erb | 44 +++++++++++++++++++ app/views/users/_user_form.html.erb | 2 + app/views/users/destroy.html.erb | 17 +++++++ config/routes.rb | 2 +- lib/mumuki/laboratory/locales/en.yml | 7 +++ lib/mumuki/laboratory/locales/es-CL.yml | 9 ++++ lib/mumuki/laboratory/locales/es.yml | 7 +++ lib/mumuki/laboratory/locales/pt.yml | 5 +++ 10 files changed, 114 insertions(+), 1 deletion(-) create mode 100644 app/views/users/_user_delete_account.html.erb create mode 100644 app/views/users/_user_delete_modal.html.erb create mode 100644 app/views/users/destroy.html.erb diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 56998ab415..6eee688dcd 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -12,6 +12,9 @@ def update redirect_after! :profile_completion, fallback_location: user_path end + def destroy + end + def accept_profile_terms current_user.accept_profile_terms! flash.notice = I18n.t(:terms_accepted) diff --git a/app/views/users/_user_delete_account.html.erb b/app/views/users/_user_delete_account.html.erb new file mode 100644 index 0000000000..554f6e107b --- /dev/null +++ b/app/views/users/_user_delete_account.html.erb @@ -0,0 +1,19 @@ +
+

<%= t :delete_account %>

+
+
+

<%= t :delete_account_explain %>

+
+
+
+ +
+
+
+
+ +<%= content_for :no_container do %> + <%= render partial: 'user_delete_modal' %> +<% end %> diff --git a/app/views/users/_user_delete_modal.html.erb b/app/views/users/_user_delete_modal.html.erb new file mode 100644 index 0000000000..9c41600885 --- /dev/null +++ b/app/views/users/_user_delete_modal.html.erb @@ -0,0 +1,44 @@ + + + diff --git a/app/views/users/_user_form.html.erb b/app/views/users/_user_form.html.erb index 921a3865ca..b5787395b2 100644 --- a/app/views/users/_user_form.html.erb +++ b/app/views/users/_user_form.html.erb @@ -33,6 +33,8 @@
<%= t :programming_since %>: <%= t(:time_since, time: time_ago_in_words(@user.created_at)) %>
+
+ <%= render partial: 'user_delete_account' %>
diff --git a/app/views/users/destroy.html.erb b/app/views/users/destroy.html.erb new file mode 100644 index 0000000000..387213aca3 --- /dev/null +++ b/app/views/users/destroy.html.erb @@ -0,0 +1,17 @@ +<%= content_for :breadcrumbs do %> + <%= breadcrumbs @user %> +<% end %> + +
+
+

+ <%= t :delete_account %> +

+
+
+ +
+
+ <%= t :delete_account_confirmation_email_explain_html, user_email: @user.email, support_email: 'soporte@mumuki.org' %> +
+
diff --git a/config/routes.rb b/config/routes.rb index 945f5b1e09..dd08431585 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -56,7 +56,7 @@ resources :exams, only: :show # Current user - resource :user, only: [:show, :edit, :update] do + resource :user, only: [:show, :edit, :update, :destroy] do get :terms post :terms, to: 'users#accept_profile_terms' diff --git a/lib/mumuki/laboratory/locales/en.yml b/lib/mumuki/laboratory/locales/en.yml index 75fe1fbffa..8c18e16bec 100644 --- a/lib/mumuki/laboratory/locales/en.yml +++ b/lib/mumuki/laboratory/locales/en.yml @@ -64,6 +64,13 @@ en: create_submission: Submit created_at: Created at date: Date + delete_account: Delete account + delete_account_agree: I understand the consequences and want to delete my account + delete_account_confirmation_email_explain_html:

We sent you an email to %{user_email} to continue with the removal process. + delete_account_confirmation_request: To confirm this action, please write + delete_account_confirmation_text: delete my account + delete_account_explain: After deleting your account, you will lose access to all the contents and to your progress. + delete_account_modal_explain_html:

You're about to delete %{name} account

By doing that, you will lose access to the following paths:

description: Description destroy: Destroy destroy_message: delete the message diff --git a/lib/mumuki/laboratory/locales/es-CL.yml b/lib/mumuki/laboratory/locales/es-CL.yml index 702e81a527..b1f713ecd4 100644 --- a/lib/mumuki/laboratory/locales/es-CL.yml +++ b/lib/mumuki/laboratory/locales/es-CL.yml @@ -64,6 +64,15 @@ es-CL: date: Fecha day: Día days: Días + delete_account: Eliminar cuenta + delete_account_agree: Comprendo las consecuencias y quiero eliminar mi cuenta + delete_account_confirmation_email_explain_html:

Te enviamos un correo electrónico a %{user_email} para continuar con el proceso de eliminación.

+ delete_account_confirmation_request: Para confirmar esta acción, escribí + delete_account_confirmation_text: quiero eliminar mi cuenta +

Si no lo recibiste, por favor escribinos a %{support_email}.

+ delete_account_explain: Al eliminar tu cuenta, perderás acceso a todos los contenidos, así como a tu progreso. + delete_account_modal_explain_html:

Estás a punto de eliminar la cuenta de %{name}

+

Al hacerlo, perderás acceso a los siguientes recorridos:

description: Descripción destroy_message: eliminar el mensaje destroy: Eliminar diff --git a/lib/mumuki/laboratory/locales/es.yml b/lib/mumuki/laboratory/locales/es.yml index 27cfd6a138..b921d555dd 100644 --- a/lib/mumuki/laboratory/locales/es.yml +++ b/lib/mumuki/laboratory/locales/es.yml @@ -70,6 +70,13 @@ es: date: Fecha day: Día days: Días + delete_account: Eliminar cuenta + delete_account_agree: Comprendo las consecuencias y quiero eliminar mi cuenta + delete_account_confirmation_email_explain_html:

Te enviamos un correo electrónico a %{user_email} para continuar con el proceso de eliminación.

Si no lo recibiste, por favor escribinos a %{support_email}.

+ delete_account_confirmation_request: Para confirmar esta acción, escribí + delete_account_confirmation_text: quiero eliminar mi cuenta + delete_account_explain: Al eliminar tu cuenta, perderás acceso a todos los contenidos, así como a tu progreso. + delete_account_modal_explain_html:

Estás a punto de eliminar la cuenta de %{name}

Al hacerlo, perderás acceso a los siguientes recorridos:

description: Descripción destroy_message: eliminar el mensaje destroy: Eliminar diff --git a/lib/mumuki/laboratory/locales/pt.yml b/lib/mumuki/laboratory/locales/pt.yml index 23f85119f0..82c03aba4f 100644 --- a/lib/mumuki/laboratory/locales/pt.yml +++ b/lib/mumuki/laboratory/locales/pt.yml @@ -67,6 +67,11 @@ pt: date: Data day: Dia days: Dias + delete_account: Deletar conta + delete_account_agree: + delete_account_confirmation_email_explain_html: + delete_account_explain: + delete_account_modal_explain_html: description: Descrição destroy_message: excluir a mensagem destroy: Excluir From 0617d5b189c167f3e31e784e0695c54a3d86dbde Mon Sep 17 00:00:00 2001 From: Federico Aloi Date: Wed, 10 Mar 2021 20:34:01 -0300 Subject: [PATCH 02/10] Send delete confirmation mail on submit --- README.md | 11 +++++++++++ app/controllers/users_controller.rb | 5 +++++ app/helpers/mailer_helper.rb | 11 +++++++++++ app/mailers/application_mailer.rb | 1 + app/mailers/user_mailer.rb | 6 ++++++ app/views/user_mailer/delete_account.text.erb | 6 ++++++ app/views/users/destroy.html.erb | 4 ++-- config/routes.rb | 1 + lib/mumuki/laboratory/locales/en.yml | 1 + lib/mumuki/laboratory/locales/es-CL.yml | 1 + lib/mumuki/laboratory/locales/es.yml | 1 + spec/controllers/users_controller_spec.rb | 19 +++++++++++++++++-- spec/dummy/config/environments/development.rb | 9 ++++++--- spec/dummy/db/schema.rb | 6 +++++- spec/mailers/user_mailer_spec.rb | 7 +++++++ 15 files changed, 81 insertions(+), 8 deletions(-) create mode 100644 app/helpers/mailer_helper.rb create mode 100644 app/views/user_mailer/delete_account.text.erb diff --git a/README.md b/README.md index d46d198aef..d4a921c179 100644 --- a/README.md +++ b/README.md @@ -205,6 +205,17 @@ o.reindex_usages! Now you will be able to visit that guide at `http://localhost:3000/central/guides/#{slug}` +## Debugging email sender + +The development environment is configured to "send" emails via `mailcatcher`, a mock server, if it is available. Run these commands to install and run it - and do it _before_ the emails are sent, so it can actually _catch_ them: + +```bash +gem install mailcatcher +mailcatcher +``` + +Once up and running, go to http://localhost:1080/ to see which emails have been sent. Unfortunately, the developers recommend not to install it via Bundler, so it has to be done this way. :woman_shrugging: + ## JavaScript API Docs In order to be customized by runners, Laboratory exposes the following selectors and methods diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 6eee688dcd..ec245fa7ce 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -13,6 +13,8 @@ def update end def destroy + current_user.generate_delete_account_token! + UserMailer.delete_account(current_user).deliver_now end def accept_profile_terms @@ -44,6 +46,9 @@ def unsubscribe redirect_to root_path, notice: t(:unsubscribed_successfully) end + def delete + end + def permissible_params super << [:avatar_id, :avatar_type] end diff --git a/app/helpers/mailer_helper.rb b/app/helpers/mailer_helper.rb new file mode 100644 index 0000000000..41c613f3cc --- /dev/null +++ b/app/helpers/mailer_helper.rb @@ -0,0 +1,11 @@ +module MailerHelper + def delete_account_url_for(user) + delete_user_url host: organic_domain_for(user), token: user.delete_account_token + end + + private + + def organic_domain_for(user) + Mumukit::Platform.laboratory.organic_domain(user.last_organization) + end +end diff --git a/app/mailers/application_mailer.rb b/app/mailers/application_mailer.rb index 8900a21ac3..8cdc76634a 100644 --- a/app/mailers/application_mailer.rb +++ b/app/mailers/application_mailer.rb @@ -1,5 +1,6 @@ class ApplicationMailer < ActionMailer::Base default from: Rails.configuration.reminder_sender_email + add_template_helper MailerHelper layout 'mailer' def self.mailer_environment_variables diff --git a/app/mailers/user_mailer.rb b/app/mailers/user_mailer.rb index d69b21136a..040c42559f 100644 --- a/app/mailers/user_mailer.rb +++ b/app/mailers/user_mailer.rb @@ -20,6 +20,12 @@ def no_submissions_reminder(user) end end + def delete_account(user) + with_locale(user) do + build_email t(:delete_account_mumuki), 'delete_account' + end + end + def certificate(certificate) with_locale certificate.user, certificate.organization do attachments[certificate.filename] = pdf_for(certificate) diff --git a/app/views/user_mailer/delete_account.text.erb b/app/views/user_mailer/delete_account.text.erb new file mode 100644 index 0000000000..e4395335ae --- /dev/null +++ b/app/views/user_mailer/delete_account.text.erb @@ -0,0 +1,6 @@ +<%= delete_account_url_for @user %> + +© Copyright 2015-<%= DateTime.now.year %> Mumuki. + +<%= t :stop_emails? %> +<%= t :cancel_subscription %> diff --git a/app/views/users/destroy.html.erb b/app/views/users/destroy.html.erb index 387213aca3..bdf47c00ce 100644 --- a/app/views/users/destroy.html.erb +++ b/app/views/users/destroy.html.erb @@ -11,7 +11,7 @@
-
- <%= t :delete_account_confirmation_email_explain_html, user_email: @user.email, support_email: 'soporte@mumuki.org' %> +
+ <%= t :delete_account_confirmation_email_explain_html, user_email: @user.email, support_email: Rails.configuration.reminder_sender_email %>
diff --git a/config/routes.rb b/config/routes.rb index dd08431585..96fc2133ce 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -66,6 +66,7 @@ get :messages get :discussions get :certificates + get :delete end resources :faqs, only: [:index] diff --git a/lib/mumuki/laboratory/locales/en.yml b/lib/mumuki/laboratory/locales/en.yml index 8c18e16bec..3861305661 100644 --- a/lib/mumuki/laboratory/locales/en.yml +++ b/lib/mumuki/laboratory/locales/en.yml @@ -71,6 +71,7 @@ en: delete_account_confirmation_text: delete my account delete_account_explain: After deleting your account, you will lose access to all the contents and to your progress. delete_account_modal_explain_html:

You're about to delete %{name} account

By doing that, you will lose access to the following paths:

+ delete_account_mumuki: Delete your Mumuki account description: Description destroy: Destroy destroy_message: delete the message diff --git a/lib/mumuki/laboratory/locales/es-CL.yml b/lib/mumuki/laboratory/locales/es-CL.yml index b1f713ecd4..20db1c9e74 100644 --- a/lib/mumuki/laboratory/locales/es-CL.yml +++ b/lib/mumuki/laboratory/locales/es-CL.yml @@ -73,6 +73,7 @@ es-CL: delete_account_explain: Al eliminar tu cuenta, perderás acceso a todos los contenidos, así como a tu progreso. delete_account_modal_explain_html:

Estás a punto de eliminar la cuenta de %{name}

Al hacerlo, perderás acceso a los siguientes recorridos:

+ delete_account_mumuki: Eliminar tu cuenta de Mumuki description: Descripción destroy_message: eliminar el mensaje destroy: Eliminar diff --git a/lib/mumuki/laboratory/locales/es.yml b/lib/mumuki/laboratory/locales/es.yml index b921d555dd..8abf62d3d0 100644 --- a/lib/mumuki/laboratory/locales/es.yml +++ b/lib/mumuki/laboratory/locales/es.yml @@ -77,6 +77,7 @@ es: delete_account_confirmation_text: quiero eliminar mi cuenta delete_account_explain: Al eliminar tu cuenta, perderás acceso a todos los contenidos, así como a tu progreso. delete_account_modal_explain_html:

Estás a punto de eliminar la cuenta de %{name}

Al hacerlo, perderás acceso a los siguientes recorridos:

+ delete_account_mumuki: Eliminar tu cuenta de Mumuki description: Descripción destroy_message: eliminar el mensaje destroy: Eliminar diff --git a/spec/controllers/users_controller_spec.rb b/spec/controllers/users_controller_spec.rb index cc2d8f01d5..38647c71b6 100644 --- a/spec/controllers/users_controller_spec.rb +++ b/spec/controllers/users_controller_spec.rb @@ -1,7 +1,7 @@ require 'spec_helper' describe UsersController, type: :controller, organization_workspace: :test do - let(:user) { create(:user) } + let(:user) { create(:user, email: 'pirulo@mail.com') } let(:user_json) do { @@ -11,11 +11,26 @@ } end + before { set_current_user! user } + context 'put' do - before { set_current_user! user } before { put :update, body: { user: user_json }.to_json, as: :json } it { expect(User.last.first_name).to eq 'foo' } it { expect(User.last.verified_first_name).to be_nil } end + + context 'delete' do + let(:last_email) { ActionMailer::Base.deliveries.last } + before { delete :destroy } + + context 'sends a delete confirmation email' do + it { expect(last_email.to).to eq ['pirulo@mail.com'] } + it { expect(last_email.subject).to have_content 'Delete your Mumuki account' } + end + + context 'adds a delete token to the user' do + it { expect(user.reload.delete_account_token).not_to be_nil } + end + end end diff --git a/spec/dummy/config/environments/development.rb b/spec/dummy/config/environments/development.rb index 1c9aaa5be3..0f23ab0405 100644 --- a/spec/dummy/config/environments/development.rb +++ b/spec/dummy/config/environments/development.rb @@ -26,10 +26,13 @@ config.cache_store = :null_store end - # Don't care if the mailer can't send. - config.action_mailer.perform_deliveries = false - + config.reminder_sender_email = 'support@mumuki.org' config.action_mailer.perform_caching = false + config.action_mailer.raise_delivery_errors = false + + # Settings for mailcatcher, run `mailcatcher` and go to http://localhost:1080/ to see which emails have been sent. + config.action_mailer.smtp_settings = { :address => '127.0.0.1', :port => 1025 } + config.action_mailer.delivery_method = :smtp # Print deprecation notices to the Rails logger. config.active_support.deprecation = :log diff --git a/spec/dummy/db/schema.rb b/spec/dummy/db/schema.rb index e31c2bb051..5b1ee66cf6 100644 --- a/spec/dummy/db/schema.rb +++ b/spec/dummy/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20210302181654) do +ActiveRecord::Schema.define(version: 20210310195602) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -121,6 +121,8 @@ t.integer "organization_id" t.datetime "created_at", null: false t.datetime "updated_at", null: false + t.datetime "period_start" + t.datetime "period_end" end create_table "discussions", force: :cascade do |t| @@ -507,6 +509,8 @@ t.datetime "forum_terms_accepted_at" t.boolean "banned_from_forum" t.boolean "uppercase_mode" + t.string "delete_account_token" + t.datetime "delete_account_token_expiration" t.index ["avatar_type", "avatar_id"], name: "index_users_on_avatar_type_and_avatar_id" t.index ["disabled_at"], name: "index_users_on_disabled_at" t.index ["last_organization_id"], name: "index_users_on_last_organization_id" diff --git a/spec/mailers/user_mailer_spec.rb b/spec/mailers/user_mailer_spec.rb index 3f33616867..59e45232ca 100644 --- a/spec/mailers/user_mailer_spec.rb +++ b/spec/mailers/user_mailer_spec.rb @@ -198,4 +198,11 @@ it { expect(email.from).to eq ['info@mumuki.org'] } end end + + describe 'delete account email' do + let(:user) { create(:user, delete_account_token: 'SecreT1234', last_organization: central) } + let(:email) { UserMailer.delete_account(user) } + + it { expect(email.body.encoded).to include 'central.localmumuki.io/user/delete?token=SecreT1234' } + end end From b06bbc19412f33b12bde0b8bed52243a76ade4aa Mon Sep 17 00:00:00 2001 From: Federico Aloi Date: Thu, 11 Mar 2021 17:41:52 -0300 Subject: [PATCH 03/10] Final step of delete account flow --- app/controllers/users_controller.rb | 21 +++++++++++++------ app/helpers/mailer_helper.rb | 2 +- app/views/users/_user_delete_account.html.erb | 2 +- ...html.erb => _user_delete_confirmation.erb} | 0 app/views/users/_user_delete_modal.html.erb | 4 ++-- app/views/users/delete_confirmation.html.erb | 11 ++++++++++ app/views/users/delete_request.html.erb | 5 +++++ config/routes.rb | 5 ++++- spec/controllers/users_controller_spec.rb | 8 +++++-- spec/mailers/user_mailer_spec.rb | 2 +- 10 files changed, 46 insertions(+), 14 deletions(-) rename app/views/users/{destroy.html.erb => _user_delete_confirmation.erb} (100%) create mode 100644 app/views/users/delete_confirmation.html.erb create mode 100644 app/views/users/delete_request.html.erb diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index ec245fa7ce..51a3c9ab83 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -12,11 +12,6 @@ def update redirect_after! :profile_completion, fallback_location: user_path end - def destroy - current_user.generate_delete_account_token! - UserMailer.delete_account(current_user).deliver_now - end - def accept_profile_terms current_user.accept_profile_terms! flash.notice = I18n.t(:terms_accepted) @@ -46,7 +41,21 @@ def unsubscribe redirect_to root_path, notice: t(:unsubscribed_successfully) end - def delete + def delete_request + end + + def send_delete_confirmation_email + current_user.generate_delete_account_token! + UserMailer.delete_account(current_user).deliver_now + redirect_to delete_request_user_path + end + + def delete_confirmation + end + + def disable + current_user.disable! + redirect_to root_path end def permissible_params diff --git a/app/helpers/mailer_helper.rb b/app/helpers/mailer_helper.rb index 41c613f3cc..1267efd51f 100644 --- a/app/helpers/mailer_helper.rb +++ b/app/helpers/mailer_helper.rb @@ -1,6 +1,6 @@ module MailerHelper def delete_account_url_for(user) - delete_user_url host: organic_domain_for(user), token: user.delete_account_token + delete_confirmation_user_url host: organic_domain_for(user), token: user.delete_account_token end private diff --git a/app/views/users/_user_delete_account.html.erb b/app/views/users/_user_delete_account.html.erb index 554f6e107b..a79b2ac2a4 100644 --- a/app/views/users/_user_delete_account.html.erb +++ b/app/views/users/_user_delete_account.html.erb @@ -15,5 +15,5 @@
<%= content_for :no_container do %> - <%= render partial: 'user_delete_modal' %> + <%= render partial: 'user_delete_modal', locals: { submit_url: delete_request_user_path } %> <% end %> diff --git a/app/views/users/destroy.html.erb b/app/views/users/_user_delete_confirmation.erb similarity index 100% rename from app/views/users/destroy.html.erb rename to app/views/users/_user_delete_confirmation.erb diff --git a/app/views/users/_user_delete_modal.html.erb b/app/views/users/_user_delete_modal.html.erb index 9c41600885..2ba3fda171 100644 --- a/app/views/users/_user_delete_modal.html.erb +++ b/app/views/users/_user_delete_modal.html.erb @@ -1,4 +1,4 @@ - + +<%= render partial: 'user_delete_confirmation' %> + +<%= content_for :no_container do %> + <%= render partial: 'user_delete_modal', locals: { submit_url: delete_confirmation_user_url } %> +<% end %> diff --git a/app/views/users/delete_request.html.erb b/app/views/users/delete_request.html.erb new file mode 100644 index 0000000000..dd4c58b407 --- /dev/null +++ b/app/views/users/delete_request.html.erb @@ -0,0 +1,5 @@ +<%= render partial: 'user_delete_confirmation' %> + +<%= content_for :no_container do %> + <%= render partial: 'user_delete_modal', locals: { submit_url: delete_request_user_url } %> +<% end %> diff --git a/config/routes.rb b/config/routes.rb index 96fc2133ce..e977c07ee8 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -66,7 +66,10 @@ get :messages get :discussions get :certificates - get :delete + get :delete_request + post :delete_request, to: 'users#send_delete_confirmation_email' + get :delete_confirmation + post :delete_confirmation, to: 'users#disable' end resources :faqs, only: [:index] diff --git a/spec/controllers/users_controller_spec.rb b/spec/controllers/users_controller_spec.rb index 38647c71b6..104c24993f 100644 --- a/spec/controllers/users_controller_spec.rb +++ b/spec/controllers/users_controller_spec.rb @@ -20,9 +20,9 @@ it { expect(User.last.verified_first_name).to be_nil } end - context 'delete' do + context 'send_delete_confirmation_email' do let(:last_email) { ActionMailer::Base.deliveries.last } - before { delete :destroy } + before { post :send_delete_confirmation_email } context 'sends a delete confirmation email' do it { expect(last_email.to).to eq ['pirulo@mail.com'] } @@ -32,5 +32,9 @@ context 'adds a delete token to the user' do it { expect(user.reload.delete_account_token).not_to be_nil } end + + context 'redirects to confirmation view' do + it { expect(response).to redirect_to(delete_request_user_path) } + end end end diff --git a/spec/mailers/user_mailer_spec.rb b/spec/mailers/user_mailer_spec.rb index 59e45232ca..db03ad84eb 100644 --- a/spec/mailers/user_mailer_spec.rb +++ b/spec/mailers/user_mailer_spec.rb @@ -203,6 +203,6 @@ let(:user) { create(:user, delete_account_token: 'SecreT1234', last_organization: central) } let(:email) { UserMailer.delete_account(user) } - it { expect(email.body.encoded).to include 'central.localmumuki.io/user/delete?token=SecreT1234' } + it { expect(email.body.encoded).to include 'central.localmumuki.io/user/delete_confirmation?token=SecreT1234' } end end From 143d03a94e85e0fef7659c09543d7f66333c3b2e Mon Sep 17 00:00:00 2001 From: Federico Aloi Date: Thu, 11 Mar 2021 17:46:12 -0300 Subject: [PATCH 04/10] Fix immersive orga broken test --- app/views/layouts/_organization_chooser.html.erb | 4 ++-- spec/features/immersive_redirection_spec.rb | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/views/layouts/_organization_chooser.html.erb b/app/views/layouts/_organization_chooser.html.erb index 2033720501..4119f3bff3 100644 --- a/app/views/layouts/_organization_chooser.html.erb +++ b/app/views/layouts/_organization_chooser.html.erb @@ -1,4 +1,4 @@ -