mumuki-laboratory 9.22.0 → 9.23.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (34) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +11 -0
  3. data/app/controllers/application_controller.rb +0 -2
  4. data/app/controllers/login_controller.rb +11 -3
  5. data/app/controllers/users_controller.rb +11 -4
  6. data/app/helpers/mailer_helper.rb +5 -0
  7. data/app/helpers/user_menu_helper.rb +7 -3
  8. data/app/mailers/application_mailer.rb +1 -0
  9. data/app/mailers/user_mailer.rb +6 -1
  10. data/app/views/layouts/_organization_chooser.html.erb +2 -2
  11. data/app/views/layouts/_user_menu.html.erb +2 -0
  12. data/app/views/user_mailer/delete_account.html.erb +7 -0
  13. data/app/views/users/_user_delete_confirmation.erb +17 -0
  14. data/app/views/users/_user_delete_modal.html.erb +35 -0
  15. data/app/views/users/delete_account.html.erb +27 -0
  16. data/app/views/users/delete_confirmation_invalid.html.erb +22 -0
  17. data/app/views/users/delete_request.html.erb +1 -0
  18. data/config/routes.rb +6 -3
  19. data/lib/mumuki/laboratory/locales/en.yml +19 -2
  20. data/lib/mumuki/laboratory/locales/es-CL.yml +19 -2
  21. data/lib/mumuki/laboratory/locales/es.yml +20 -2
  22. data/lib/mumuki/laboratory/locales/pt.yml +20 -4
  23. data/lib/mumuki/laboratory/version.rb +1 -1
  24. data/spec/capybara_helper.rb +10 -10
  25. data/spec/controllers/users_controller_spec.rb +20 -1
  26. data/spec/dummy/config/environments/development.rb +8 -2
  27. data/spec/dummy/config/environments/test.rb +4 -1
  28. data/spec/dummy/db/schema.rb +1 -1
  29. data/spec/features/dynamic_exam_spec.rb +4 -2
  30. data/spec/features/immersive_redirection_spec.rb +1 -1
  31. data/spec/mailers/previews/user_mailer_preview.rb +4 -0
  32. data/spec/mailers/user_mailer_spec.rb +10 -3
  33. metadata +31 -6
  34. data/spec/features/disable_user_flow_spec.rb +0 -32
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 132cadbd6244acaece507d8f75d1613daf1c4f9f682b1b929d5c6468102a596b
4
- data.tar.gz: 45ce5c37552fe64a9766ac4548f944f045f843177b843706277ca56f42125dbd
3
+ metadata.gz: b9a44eb8a52ea3e076a0e6dd62ba634664458f2010b8df7d5a9d36f2dc20d9fe
4
+ data.tar.gz: 16995ef8fe178a5e8f4ba5d9454e55628f7a17de7c61a61625fae017eb6beecd
5
5
  SHA512:
6
- metadata.gz: 9c6046c3ce7394386bc2f43d3e063c7eae999a70d96fde67243809e1e107d4f35638333cdf87e9af9aa5f3ae797585c82bd69a1ba293511842eb9bc4608c4518
7
- data.tar.gz: fdeaa6997d54fb7dd6a75224c25a3a40f0d2e05414b934ff1fc3e5f60568c2de6ac32b39c6bcbb0f5b6e09cffc3b53b51e6cb8264e3ade7ee1060ccd05ae4252
6
+ metadata.gz: b7b567eb9a6b759b11c2d471bed6a5221e0c1c0123e7513c70111df499169714ea05ae2c26d5c86eeaf3a3ac1f85d490b3a9d529717834c865b15bc777a3d9b0
7
+ data.tar.gz: f7c010004b5dff4fd790e89bb6701277e7d3c8bc7fbf12a7c411aecf0bb437f36defbcc911381140ac74d2f101be83859bda2ce15726fdd7b2d53b8c8e5c9d7a
data/README.md CHANGED
@@ -205,6 +205,17 @@ o.reindex_usages!
205
205
 
206
206
  Now you will be able to visit that guide at `http://localhost:3000/central/guides/#{slug}`
207
207
 
208
+ ## Debugging email sender
209
+
210
+ 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:
211
+
212
+ ```bash
213
+ gem install mailcatcher
214
+ mailcatcher
215
+ ```
216
+
217
+ 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:
218
+
208
219
  ## JavaScript API Docs
209
220
 
210
221
  In order to be customized by runners, Laboratory exposes the following selectors and methods
@@ -7,7 +7,6 @@ class ApplicationController < ActionController::Base
7
7
  include Mumukit::Login::AuthenticationHelpers
8
8
 
9
9
  include Mumuki::Laboratory::Controllers::Authorization
10
- include Mumuki::Laboratory::Controllers::Disabling
11
10
  include Mumuki::Laboratory::Controllers::Notifications
12
11
  include Mumuki::Laboratory::Controllers::DynamicErrors
13
12
  include Mumuki::Laboratory::Controllers::EmbeddedMode
@@ -18,7 +17,6 @@ class ApplicationController < ActionController::Base
18
17
  before_action :set_locale!
19
18
  before_action :set_time_zone!
20
19
 
21
- before_action :ensure_user_enabled!, if: :current_user?
22
20
  before_action :redirect_to_proper_context!, if: :immersive_context_wrong?
23
21
 
24
22
  before_action :authorize_if_private!
@@ -2,9 +2,17 @@ class LoginController < ApplicationController
2
2
  Mumukit::Login.configure_login_controller! self
3
3
 
4
4
  skip_before_action :verify_authenticity_token, if: lambda { Rails.env.development? }
5
- skip_before_action :validate_user_profile!
6
- skip_before_action :validate_accepted_role_terms!
7
- skip_before_action :validate_active_organization!
5
+ skip_before_action :validate_user_profile!,
6
+ :validate_accepted_role_terms!,
7
+ :validate_active_organization!,
8
+ :redirect_to_proper_context!,
9
+ :ensure_restore_progress!,
10
+ :visit_organization!
11
+
12
+ def logout_current_user!
13
+ flash.keep
14
+ super
15
+ end
8
16
 
9
17
  private
10
18
 
@@ -47,11 +47,18 @@ class UsersController < ApplicationController
47
47
  @exam_authorization_requests ||= ExamAuthorizationRequest.where(user: current_user, organization: Organization.current)
48
48
  end
49
49
 
50
- def unsubscribe
51
- user_id = User.unsubscription_verifier.verify(params[:id])
52
- User.find(user_id).unsubscribe_from_reminders!
50
+ def send_delete_confirmation_email
51
+ current_user.generate_delete_account_token!
52
+ UserMailer.delete_account(current_user).post!
53
+ redirect_to delete_request_user_path
54
+ end
55
+
56
+ def delete_confirmation
57
+ return redirect_to delete_confirmation_invalid_user_path unless @user.delete_account_token_matches? params[:token]
58
+
59
+ @user.destroy!
53
60
 
54
- redirect_to root_path, notice: t(:unsubscribed_successfully)
61
+ redirect_to logout_path, notice: I18n.t(:user_deleted_successfully)
55
62
  end
56
63
 
57
64
  def permissible_params
@@ -0,0 +1,5 @@
1
+ module MailerHelper
2
+ def delete_account_url_for(user)
3
+ @organization.url_for("/user/delete_confirmation?token=#{user.delete_account_token}")
4
+ end
5
+ end
@@ -35,11 +35,15 @@ module UserMenuHelper
35
35
  user_menu_item t(:notifications), notifications_user_path, 'notifications'
36
36
  end
37
37
 
38
+ def delete_account_user_menu_link
39
+ user_menu_item t(:delete_account), delete_account_user_path, 'delete_account', 'text-danger'
40
+ end
41
+
38
42
  private
39
43
 
40
- def user_menu_item(label, path, active_on)
41
- link_klass = 'active' if action_name == active_on
42
- content_tag :div, link_to(label, path, { class: link_klass }.compact), class: 'mu-user-menu-item'
44
+ def user_menu_item(label, path, active_on, link_klass = '')
45
+ active_klass = 'active' if action_name == active_on
46
+ content_tag :div, link_to(label, path, { class: "#{link_klass} #{active_klass}" }.compact), class: 'mu-user-menu-item'
43
47
  end
44
48
 
45
49
  def user_menu_header_icon
@@ -1,5 +1,6 @@
1
1
  class ApplicationMailer < ActionMailer::Base
2
2
  default from: Rails.configuration.reminder_sender_email
3
+ add_template_helper MailerHelper
3
4
  layout 'mailer'
4
5
 
5
6
  def self.mailer_environment_variables
@@ -22,6 +22,12 @@ class UserMailer < ApplicationMailer
22
22
  end
23
23
  end
24
24
 
25
+ def delete_account(user)
26
+ with_locale(user) do
27
+ build_email t(:delete_account_mumuki), 'delete_account'
28
+ end
29
+ end
30
+
25
31
  def certificate(certificate)
26
32
  with_locale certificate.user, certificate.organization do
27
33
  attachments[certificate.filename] = pdf_for(certificate)
@@ -39,7 +45,6 @@ class UserMailer < ApplicationMailer
39
45
 
40
46
  def with_locale(user, organization = nil, &block)
41
47
  @user = user
42
- @unsubscribe_code = User.unsubscription_verifier.generate(user.id)
43
48
  @organization = organization || user.last_organization
44
49
 
45
50
  I18n.with_locale(@organization.locale, &block)
@@ -1,4 +1,4 @@
1
- <div class="modal fade mu-organization-chooser" id="redirect" tabindex="-1" role="dialog" aria-hidden="true">
1
+ <div class="modal fade mu-organization-chooser" id="organization-chooser-modal" tabindex="-1" role="dialog" aria-hidden="true">
2
2
  <div class="modal-dialog">
3
3
  <div class="modal-content">
4
4
  <div class="modal-header">
@@ -14,7 +14,7 @@
14
14
  </div>
15
15
  </div>
16
16
  <script>
17
- $("#redirect").modal({
17
+ $("#organization-chooser-modal").modal({
18
18
  backdrop: 'static',
19
19
  keyboard: false
20
20
  });
@@ -12,6 +12,8 @@
12
12
  <%= activity_user_menu_link %>
13
13
  <%= certificates_user_menu_link %>
14
14
  <%= exam_authorizations_user_menu_link %>
15
+ <%= user_menu_divider %>
16
+ <%= delete_account_user_menu_link %>
15
17
  </div>
16
18
  </div>
17
19
  <div class="mu-user-menu-divider vertical d-none d-md-block"></div>
@@ -0,0 +1,7 @@
1
+ <%= render partial: 'user_mailer/mail_template', locals: {
2
+ title: t('mailer.title.delete_account'),
3
+ subtitle: t('mailer.subtitle.delete_account'),
4
+ text: t('mailer.text.delete_account').html_safe,
5
+ button: t('mailer.button.delete_account'),
6
+ url: delete_account_url_for(@user)
7
+ } %>
@@ -0,0 +1,17 @@
1
+ <%= content_for :breadcrumbs do %>
2
+ <%= breadcrumbs @user %>
3
+ <% end %>
4
+
5
+ <div class="row">
6
+ <div class="mu-inline-block-left">
7
+ <h1>
8
+ <%= t :email_sent %>
9
+ </h1>
10
+ </div>
11
+ </div>
12
+
13
+ <div class="row">
14
+ <div class="col-md-12">
15
+ <%= t :delete_account_confirmation_email_explain_html, user_email: @user.email, disable_email: Rails.configuration.disable_email %>
16
+ </div>
17
+ </div>
@@ -0,0 +1,35 @@
1
+ <div class="modal fade" id="user-delete-account-modal" tabindex="-1" role="dialog">
2
+ <div class="modal-dialog modal-lg d-table">
3
+ <div class="modal-content">
4
+ <div class="modal-header">
5
+ <h3 class="modal-title"><%= t :delete_account %></h4>
6
+ <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
7
+ </div>
8
+ <div class="modal-body">
9
+ <div class="container-fluid">
10
+ <div class="row">
11
+ <p><%= t :delete_account_modal_explain_html, user_email: @user.email %></p>
12
+ </div>
13
+ <% if @user.student_granted_organizations.present? %>
14
+ <div class="row">
15
+ <p><%= t :delete_account_modal_lost_permissions %></p>
16
+ </div>
17
+ <div class="row">
18
+ <% @user.student_granted_organizations.each do |organization| %>
19
+ <div class="col-md-4 text-center">
20
+ <%= image_tag(organization.banner_url, width: '100%', class: 'pull-left') %>
21
+ <p><%= organization.name %></p>
22
+ </div>
23
+ <% end %>
24
+ </div>
25
+ <% end %>
26
+ <div class="row">
27
+ <%= form_with class: 'mu-form', url: delete_request_user_path do |f| %>
28
+ <%= f.submit t(:delete_account_agree), class: 'btn btn-danger w-100', id: 'delete-account-button' %>
29
+ <% end %>
30
+ </div>
31
+ </div>
32
+ </div>
33
+ </div>
34
+ </div>
35
+ </div>
@@ -0,0 +1,27 @@
1
+ <%= content_for :breadcrumbs do %>
2
+ <%= breadcrumbs_for_my_account %>
3
+ <% end %>
4
+
5
+ <div class="row">
6
+ <%= render partial: 'layouts/user_menu' %>
7
+
8
+ <div class="col-md-9 mu-tab-body">
9
+ <h3 class="text-danger"><%= t :delete_account %></h3>
10
+ <div class="row">
11
+ <div class="col-md-8">
12
+ <p><%= t :delete_account_explain %></p>
13
+ </div>
14
+ <div class="col-md-4">
15
+ <div class="pull-right">
16
+ <button type="button" class="btn btn-danger" data-bs-toggle="modal" data-bs-target="#user-delete-account-modal">
17
+ <%= t :delete_account %>
18
+ </button>
19
+ </div>
20
+ </div>
21
+ </div>
22
+ </div>
23
+ </div>
24
+
25
+ <%= content_for :no_container do %>
26
+ <%= render partial: 'user_delete_modal' %>
27
+ <% end %>
@@ -0,0 +1,22 @@
1
+ <%= content_for :breadcrumbs do %>
2
+ <%= breadcrumbs @user %>
3
+ <% end %>
4
+
5
+ <div class="row">
6
+ <div class="mu-inline-block-left">
7
+ <h1>
8
+ <%= t :delete_account %>
9
+ </h1>
10
+ </div>
11
+ </div>
12
+
13
+ <div class="row">
14
+ <div class="col-md-12">
15
+ <p>
16
+ <%= t :delete_account_invalid_token %>
17
+ </p>
18
+ <p>
19
+ <%= t :delete_account_try_again_html, profile_url: user_path %>
20
+ </p>
21
+ </div>
22
+ </div>
@@ -0,0 +1 @@
1
+ <%= render partial: 'user_delete_confirmation' %>
data/config/routes.rb CHANGED
@@ -63,9 +63,6 @@ Rails.application.routes.draw do
63
63
  get :terms
64
64
  post :terms, to: 'users#accept_profile_terms'
65
65
 
66
- # Notification subscriptions
67
- get :unsubscribe
68
-
69
66
  get :messages
70
67
  get :discussions
71
68
  get :activity
@@ -76,6 +73,12 @@ Rails.application.routes.draw do
76
73
  post 'notifications/:id/toggle_read', action: :toggle_read
77
74
  get 'notifications/manage', action: :show_manage_notifications
78
75
  post 'notifications/manage', action: :manage_notifications
76
+
77
+ get :delete_account
78
+ get :delete_request
79
+ post :delete_request, to: 'users#send_delete_confirmation_email'
80
+ get :delete_confirmation_invalid
81
+ get :delete_confirmation
79
82
  end
80
83
 
81
84
  resources :faqs, only: [:index]
@@ -74,8 +74,19 @@ en:
74
74
  created_at: Created at
75
75
  date: Date
76
76
  date_and_time: Date and time
77
+ delete_account: Delete account
78
+ delete_account_agree: I understand the consequences and want to delete my account
79
+ delete_account_confirmation_email_explain_html: <p>We've sent you an email to <strong>%{user_email}</strong> to continue with the removal process. </p><p> Please, check your inbox. If you have not received it, please contact us at <a href="mailto:%{disable_email}">%{disable_email}</a>.</p>
80
+ delete_account_confirmation_request: To confirm this action, please write
81
+ delete_account_explain: Upon deleting your account, you will lose access to your progress as well as your personal data.
82
+ delete_account_invalid_token: We are sorry, the link you followed here has expired or is invalid.
83
+ delete_account_modal_explain_html: To keep your account safe, we'll send you an email to <strong>%{user_email}</strong> to continue the deletion process.
84
+ delete_account_modal_lost_permissions: 'By deleting your account, you will lose access to the following courses:'
85
+ delete_account_mumuki: Delete your Mumuki account
86
+ delete_account_try_again_html: If you still want to delete your account, start the process again from <a href="%{profile_url}">your profile</a>.
77
87
  deleted_by: Deleted by %{deleter}
78
88
  deleted_message_warning: If you repeateadly violate these or other rules, you may be prohibited from accessing the forum or you may suffer more severe consequences, such as being expulsed from the course.
89
+ deleted_user: Deleted User
79
90
  deletion_motive:
80
91
  inappropriate_content:
81
92
  present: Includes inappropriate content
@@ -106,6 +117,7 @@ en:
106
117
  edit_profile: Edit profile
107
118
  editor_placeholder: "write your solution here..."
108
119
  email: Email
120
+ email_sent: Email sent
109
121
  error:
110
122
  title:
111
123
  forbidden: You are not allowed to see this content
@@ -199,23 +211,27 @@ en:
199
211
  locked_content: 'This content will be unlocked when you finish previous chapters'
200
212
  mailer:
201
213
  title:
214
+ custom: You have a new notification!
215
+ delete_account: Confirm account deletion
202
216
  exam_authorization_request_updated: There are updates in your exam registration
203
217
  exam_authorization_request_rejected: Exam registration rejected
204
218
  exam_registration: Exam registrations open
205
- custom: You have a new notification!
206
219
  subtitle:
220
+ delete_account: You've requested to delete your Mumuki account
207
221
  exam_authorization_request_approved: Your registration request to the exam has been approved.
208
222
  exam_authorization_request_rejected: Your registration request to the exam has been rejected because the requirements weren't met.
209
223
  exam_registration: ¡You can register for the exam!
210
224
  text:
225
+ delete_account: Once your account is deleted, your progress and personal data will be deleted as well and you will not be able to access this account again or request the restoration of the deleted information. <br><br> This is irreversible and permanent. <br><br> Do you understand the consequences and still want to delete your account?
211
226
  exam_authorization_request_approved: You can sit for the exam on %{exam_start_date} by going into the platform. ¡Good luck!
212
227
  exam_authorization_request_rejected: ¡Don't be upset! You did a great job and we hope you'll keep learning programming.
213
228
  exam_registration: You have until %{exam_registration_deadline} to sign up. In order to be approved, you must meet the requirements.
214
229
  button:
230
+ custom: My notifications
231
+ delete_account: Delete Account
215
232
  exam_registration: Sign up for the exam
216
233
  exam_authorization_request_approved: Go to the platform
217
234
  exam_authorization_request_rejected: My exams
218
- custom: My notifications
219
235
  male: Male
220
236
  manage_notification_subscriptions: Manage your notification subscriptions
221
237
  manage_notifications: Manage notifications
@@ -389,6 +405,7 @@ en:
389
405
  upvotes_count_asc: Least voted
390
406
  user: User
391
407
  user_data_updated: Your data was updated successfully
408
+ user_deleted_successfully: Your account was successfully deleted
392
409
  username: Username
393
410
  verified_full_name: Verified name
394
411
  verified_full_name_notice: Your verified name was provided by %{organization}. If there's a mistake, please send an email to %{contact}.
@@ -74,8 +74,19 @@ es-CL:
74
74
  created_guides: Lecciones Creadas
75
75
  date: Fecha
76
76
  date_and_time: Fecha y hora
77
+ delete_account: Eliminar cuenta
78
+ delete_account_agree: Enviar mail para eliminar cuenta
79
+ delete_account_confirmation_email_explain_html: <p>Te enviamos un correo electrónico a <strong>%{user_email}</strong> para continuar con el proceso de eliminación. </p><p> Por favor, revisá tu casilla. Si no lo recibiste, escríbenos a <a href="mailto:%{disable_email}">%{disable_email}</a>.</p>
80
+ delete_account_confirmation_request: Para confirmar esta acción, escribí
81
+ delete_account_explain: Al eliminar tu cuenta se eliminarán también tu progreso y todos tus datos personales.
82
+ delete_account_invalid_token: Lo sentimos, el enlace que utilizaste ha expirado o es inválido.
83
+ delete_account_modal_explain_html: Por cuestiones de seguridad, para eliminar tu cuenta te enviaremos un mail a tu casilla <strong>%{user_email}</strong>.
84
+ delete_account_modal_lost_permissions: 'Al eliminar tu cuenta perderás el acceso a los siguientes cursos:'
85
+ delete_account_mumuki: Eliminar tu cuenta de Mumuki
86
+ delete_account_try_again_html: Si todavía quieres eliminar tu cuenta, vuelve a iniciar el proceso desde <a href="%{profile_url}">tu perfil</a>.
77
87
  deleted_by: Eliminado por %{deleter}
78
88
  deleted_message_warning: Si infringes reiteradamente estas u otras reglas del Espacio de Consultas, se te puede prohibir el acceso al mismo o podrás sufrir consecuencias más severas, como la expulsión del curso.
89
+ deleted_user: Cuenta Eliminada
79
90
  deletion_motive:
80
91
  inappropriate_content:
81
92
  present: Incluye contenido inapropiado
@@ -107,6 +118,7 @@ es-CL:
107
118
  edit_message: Editar mensaje
108
119
  editor_placeholder: "...escribe tu solución acá..."
109
120
  email: Email
121
+ email_sent: Email enviado
110
122
  error_description: Esto es lo que se conoce como <span class="error-link">%{error}</span>.
111
123
  error_401: error 401
112
124
  error_403: error 403
@@ -203,23 +215,27 @@ es-CL:
203
215
  locked_content: 'Éste contenido se desbloqueará cuando termines los capítulos anteriores'
204
216
  mailer:
205
217
  title:
218
+ custom: ¡Tenés una nueva notificación!
219
+ delete_account: Confirmar eliminación de cuenta
206
220
  exam_authorization_request_updated: Tenés cambios en tu inscripción al examen
207
221
  exam_authorization_request_rejected: Inscripción rechazada
208
222
  exam_registration: Apertura de inscripciones
209
- custom: ¡Tenés una nueva notificación!
210
223
  subtitle:
224
+ delete_account: Solicitaste eliminar tu cuenta de Mumuki
211
225
  exam_authorization_request_approved: Tu solicitud de inscripción al examen fue aprobada.
212
226
  exam_authorization_request_rejected: Tu solicitud de inscripción al examen fue rechazada ya que no se cumplieron los requisitos.
213
227
  exam_registration: ¡Ya podés inscribirte al examen!
214
228
  text:
229
+ delete_account: Una vez que se elimine tu cuenta se eliminarán también tu progreso y todos tus datos personales y no podrás volver a acceder a esta cuenta ni pedir la restitución futura de la información. <br><br> Esta acción es irreversible y permanente. <br><br> ¿Entiendes las consecuencias y aún así quieres eliminar tu cuenta?
215
230
  exam_authorization_request_approved: Podrás rendir el examen el día %{exam_start_date} ingresando a la plataforma. ¡Éxitos!
216
231
  exam_authorization_request_rejected: ¡No te desanimes! Hiciste un gran esfuerzo y esperamos que continúes aprendiendo programación.
217
232
  exam_registration: Tenés tiempo de inscribirte hasta el %{exam_registration_deadline}. Para que tu inscripción sea aceptada debés cumplir con los requisitos.
218
233
  button:
234
+ custom: Mis notificaciones
235
+ delete_account: Eliminar Cuenta
219
236
  exam_registration: Inscribirme al Examen
220
237
  exam_authorization_request_approved: Ir a la plataforma
221
238
  exam_authorization_request_rejected: Mis exámenes
222
- custom: Mis notificaciones
223
239
  male: Hombre
224
240
  manage_notification_subscriptions: Administrá tus notificaciones
225
241
  manage_notifications: Administrar notificaciones
@@ -403,6 +419,7 @@ es-CL:
403
419
  upvotes_count_desc: Más útiles
404
420
  upvotes_count_asc: Menos útiles
405
421
  user_data_updated: Tus datos se actualizaron correctamente
422
+ user_deleted_successfully: Tu cuenta fue eliminada exitosamente
406
423
  user: Usuario
407
424
  username: Nombre de usuario
408
425
  verified_full_name: Nombre verificado
@@ -79,8 +79,19 @@ es:
79
79
  created_guides: Lecciones Creadas
80
80
  date: Fecha
81
81
  date_and_time: Fecha y hora
82
+ delete_account: Eliminar cuenta
83
+ delete_account_agree: Enviar mail para eliminar cuenta
84
+ delete_account_confirmation_email_explain_html: <p>Te enviamos un correo electrónico a <strong>%{user_email}</strong> para continuar con el proceso de eliminación. </p><p> Por favor, revisá tu casilla. Si no lo recibiste, escribinos a <a href="mailto:%{disable_email}">%{disable_email}</a>.</p>
85
+ delete_account_confirmation_request: Para confirmar esta acción, escribí
86
+ delete_account_explain: Al eliminar tu cuenta se eliminarán también tu progreso y todos tus datos personales.
87
+ delete_account_invalid_token: Lo sentimos, el enlace que utilizaste ha expirado o es inválido.
88
+ delete_account_modal_explain_html: Por cuestiones de seguridad, para eliminar tu cuenta te enviaremos un mail a tu casilla <strong>%{user_email}</strong>.
89
+ delete_account_modal_lost_permissions: 'Al eliminar tu cuenta perderás el acceso a los siguientes cursos:'
90
+ delete_account_mumuki: Eliminar tu cuenta de Mumuki
91
+ delete_account_try_again_html: Si todavía querés eliminar tu cuenta, volvé a iniciar el proceso desde <a href="%{profile_url}">tu perfil</a>.
82
92
  deleted_by: Eliminado por %{deleter}
83
93
  deleted_message_warning: Si infringís reiteradamente estas u otras reglas del Espacio de Consultas, se te puede prohibir el acceso al mismo o podrás sufrir consecuencias más severas, como la expulsión del curso.
94
+ deleted_user: Cuenta Eliminada
84
95
  deletion_motive:
85
96
  inappropriate_content:
86
97
  present: Incluye contenido inapropiado
@@ -93,6 +104,7 @@ es:
93
104
  past: Divulgaba información personal
94
105
  day: Día
95
106
  days: Días
107
+ delete_account: Eliminar Cuenta
96
108
  description: Descripción
97
109
  destroy_message: eliminar el mensaje
98
110
  destroy: Eliminar
@@ -114,6 +126,7 @@ es:
114
126
  edit_profile: Editar perfil
115
127
  editor_placeholder: "...escribí tu solución acá..."
116
128
  email: Email
129
+ email_sent: Email enviado
117
130
  error_description: Esto es lo que se conoce como <span class="error-link">%{error}</span>.
118
131
  error_401: error 401
119
132
  error_403: error 403
@@ -212,23 +225,27 @@ es:
212
225
  locked_content: 'Este contenido se desbloqueará cuando termines los capítulos anteriores'
213
226
  mailer:
214
227
  title:
228
+ custom: ¡Tenés una nueva notificación!
229
+ delete_account: Confirmar eliminación de cuenta
215
230
  exam_authorization_request_updated: Tenés cambios en tu inscripción al examen
216
231
  exam_authorization_request_rejected: Inscripción rechazada
217
232
  exam_registration: Apertura de inscripciones
218
- custom: ¡Tenés una nueva notificación!
219
233
  subtitle:
234
+ delete_account: Solicitaste eliminar tu cuenta de Mumuki
220
235
  exam_authorization_request_approved: Tu solicitud de inscripción al examen fue aprobada.
221
236
  exam_authorization_request_rejected: Tu solicitud de inscripción al examen fue rechazada ya que no se cumplieron los requisitos.
222
237
  exam_registration: ¡Ya podés inscribirte al examen!
223
238
  text:
239
+ delete_account: Una vez que se elimine tu cuenta se eliminarán también tu progreso y todos tus datos personales y no podrás volver a acceder a esta cuenta ni pedir la restitución futura de la información. <br><br> Esta acción es irreversible y permanente. <br><br> ¿Entendés las consecuencias y aún así querés eliminar tu cuenta?
224
240
  exam_authorization_request_approved: Podrás rendir el examen el día %{exam_start_date} ingresando a la plataforma. ¡Éxitos!
225
241
  exam_authorization_request_rejected: ¡No te desanimes! Hiciste un gran esfuerzo y esperamos que continúes aprendiendo programación.
226
242
  exam_registration: Tenés tiempo de inscribirte hasta el %{exam_registration_deadline}. Para que tu inscripción sea aceptada debés cumplir con los requisitos.
227
243
  button:
244
+ custom: Mis notificaciones
245
+ delete_account: Eliminar cuenta
228
246
  exam_registration: Inscribirme al Examen
229
247
  exam_authorization_request_approved: Ir a la plataforma
230
248
  exam_authorization_request_rejected: Mis exámenes
231
- custom: Mis notificaciones
232
249
  male: Hombre
233
250
  manage_notification_subscriptions: Administrá tus notificaciones
234
251
  manage_notifications: Administrar notificaciones
@@ -417,6 +434,7 @@ es:
417
434
  upvotes_count_desc: Más útiles
418
435
  upvotes_count_asc: Menos útiles
419
436
  user_data_updated: Tus datos se actualizaron correctamente
437
+ user_deleted_successfully: Tu cuenta fue eliminada exitosamente
420
438
  user: Usuario
421
439
  username: Nombre de usuario
422
440
  verified_full_name: Nombre verificado
@@ -75,8 +75,19 @@ pt:
75
75
  created_guides: Lições criadas
76
76
  date: Data
77
77
  date_and_time: Data e hora
78
- deleted_by: Removido pelo
78
+ delete_account: Deletar conta
79
+ delete_account_agree: Eu entendo as consequências e quero excluir minha conta
80
+ delete_account_confirmation_email_explain_html: <p> Enviamos a você um e-mail para <strong>%{user_email}</strong> para continuar com o processo de exclusão. </p><p> Por favor, verifique sua caixa. Se você não o recebeu, escreva para <a href="mailto:%{disable_email}">%{disable_email}</a>.</p>
81
+ delete_account_confirmation_request: Para confirmar esta ação, por favor escreva
82
+ delete_account_explain: Excluir sua conta também excluirá seu progresso e todos os seus dados pessoais.
83
+ delete_account_invalid_token: Desculpe, o link que você usou expirou ou é inválido.
84
+ delete_account_modal_explain_html: Por razões de segurança, para excluir sua conta, enviaremos um e-mail para seu e-mail <strong>%{user_email}</strong>.
85
+ delete_account_modal_lost_permissions: 'Ao deletar sua conta você perderá acesso aos seguintes cursos:'
86
+ delete_account_mumuki: Exclua sua conta Mumuki
87
+ delete_account_try_again_html: Se você ainda deseja excluir sua conta, inicie o processo novamente a partir de <a href="%{profile_url}">seu perfil</a>.
88
+ deleted_by: Removido pelo %{deleter}
79
89
  deleted_message_warning: Se você violar repetidamente essas ou outras regras da Área de Consulta, seu acesso a ela pode ser proibido ou você pode sofrer consequências mais graves, como a expulsão do curso.
90
+ deleted_user: Conta excluída
80
91
  deletion_motive:
81
92
  inappropriate_content:
82
93
  present: Inclui conteúdo impróprio
@@ -109,6 +120,7 @@ pt:
109
120
  edit_profile: Editar perfil
110
121
  editor_placeholder: ... Escreva sua solução aqui ...
111
122
  email: E-mail
123
+ email_sent: Email enviado
112
124
  error:
113
125
  title:
114
126
  forbidden: Você não tem autorização para ver esse conteúdo
@@ -203,23 +215,27 @@ pt:
203
215
  locked_content: 'Este conteúdo será desbloqueado quando você terminar os capítulos anteriores'
204
216
  mailer:
205
217
  title:
218
+ custom: Você tem uma nova notificação!
219
+ delete_account: Confirme a exclusão da conta
206
220
  exam_authorization_request_updated: Você tem alterações no registro do seu exame
207
221
  exam_authorization_request_rejected: Inscrição rejeitada
208
222
  exam_registration: Abertura de inscrições
209
- custom: Você tem uma nova notificação!
210
223
  subtitle:
224
+ delete_account: Você solicitou a exclusão de sua conta Mumuki
211
225
  exam_authorization_request_approved: Seu pedido de inscrição para o exame foi aprovado.
212
226
  exam_authorization_request_rejected: Sua inscrição para o exame foi rejeitada porque os requisitos não foram atendidos.
213
227
  exam_registration: Agora você pode se inscrever para o exame!
214
228
  text:
229
+ delete_account: Assim que sua conta for excluída, seu progresso e todos os seus dados pessoais também serão excluídos e você não poderá acessar esta conta novamente ou solicitar a restauração futura das informações. <br><br> Esta ação é irreversível e permanente. <br><br> Você entende as consequências e ainda deseja excluir sua conta?
215
230
  exam_authorization_request_approved: Você poderá fazer o exame em %{exam_start_date} ao entrar na plataforma. Êxitos!
216
231
  exam_authorization_request_rejected: Não te desanimes! Você fez um grande esforço e esperamos que continue aprendendo programação.
217
232
  exam_registration: Você tem tempo para se registrar até o exam_registration_deadline. Para que seu registro seja aceito, você deve atender aos requisitos.
218
233
  button:
234
+ custom: Minhas notificações
235
+ delete_account: Deletar conta
219
236
  exam_registration: Assinar o exame
220
237
  exam_authorization_request_approved: Vá para a plataforma
221
238
  exam_authorization_request_rejected: Meus exames
222
- custom: Minhas notificações
223
239
  male: Masculino
224
240
  manage_notification_subscriptions: Gerenciar suas notificações
225
241
  manage_notifications: Gerenciar notificações
@@ -228,7 +244,6 @@ pt:
228
244
  message: Mensagem
229
245
  message_deleted: Esta mensagem foi excluída porque %{motive}, o que viola as %{forum_terms}.
230
246
  messages: Mensagens
231
- mais tarde!
232
247
  messages_pluralized:
233
248
  one: Mensagem
234
249
  other: Mensagens
@@ -388,6 +403,7 @@ pt:
388
403
  to_solved: Marcar como resolvida
389
404
  toggle_read: "Marcar como lido / não lido"
390
405
  unauthorized_explanation: Opa! Isso é o que é conhecido como %{error}, ou seja, você não fez logon.
406
+ user_deleted_successfully: Sua conta foi excluída com sucesso
391
407
  total: Total
392
408
  uncategorized: Não classificado
393
409
  unlocked_medal_as_avatar: Você ganhou essa medalha! Agora você pode escolhê-la como avatar.
@@ -1,5 +1,5 @@
1
1
  module Mumuki
2
2
  module Laboratory
3
- VERSION = '9.22.0'
3
+ VERSION = '9.23.0'
4
4
  end
5
5
  end
@@ -37,13 +37,11 @@ def selected_driver
37
37
  :selenium_headless
38
38
  when 'safari'
39
39
  :selenium_safari
40
- else
41
- :rack_test
42
40
  end
43
41
  end
44
42
 
45
43
  def run_with_selenium?
46
- selected_driver.to_s.start_with? 'selenium'
44
+ selected_driver
47
45
  end
48
46
 
49
47
  def register_safari_driver!
@@ -97,10 +95,15 @@ def exclude_selenium_failing_tests!
97
95
  end
98
96
  end
99
97
 
100
- # Configuration
101
-
102
98
  register_safari_driver! if selected_driver == :selenium_safari
103
- Capybara.default_driver = selected_driver
99
+
100
+ # If no driver is selected, it will use RackTest (fastest) except for tests that explicitly require JS support.
101
+ # See https://github.com/teamcapybara/capybara#using-capybara-with-rspec for more details about this behavior.
102
+ Capybara.default_driver = selected_driver || :rack_test
103
+ Capybara.javascript_driver = selected_driver || :selenium_headless
104
+
105
+ # Include port on the URL, so we don't need to forward it via nginx or so.
106
+ Capybara.always_include_port = true
104
107
 
105
108
  # TODO: fix the tests that depend on hidden elements and remove this
106
109
  Capybara.ignore_hidden_elements = false
@@ -108,9 +111,6 @@ Capybara.ignore_hidden_elements = false
108
111
  if run_with_selenium?
109
112
  register_request_headers_workaround!
110
113
  exclude_selenium_failing_tests!
111
-
112
- # Include port on the URL, so we don't need to forward it via nginx or so
113
- Capybara.always_include_port = true
114
114
  end
115
115
 
116
- puts "Running Capybara tests with #{selected_driver}, #{Capybara.ignore_hidden_elements ? '' : 'not '}ignoring hidden elements"
116
+ puts "Running Capybara tests with #{Capybara.default_driver}, #{Capybara.ignore_hidden_elements ? '' : 'not '}ignoring hidden elements"
@@ -1,7 +1,7 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe UsersController, type: :controller, organization_workspace: :test do
4
- let(:user) { create(:user) }
4
+ let(:user) { create(:user, email: 'pirulo@mail.com') }
5
5
 
6
6
  let(:user_json) do
7
7
  {
@@ -67,4 +67,23 @@ describe UsersController, type: :controller, organization_workspace: :test do
67
67
  end
68
68
  end
69
69
  end
70
+
71
+ context 'send_delete_confirmation_email' do
72
+ let(:last_email) { ActionMailer::Base.deliveries.last }
73
+ before { set_current_user! user }
74
+ before { post :send_delete_confirmation_email }
75
+
76
+ context 'sends a delete confirmation email' do
77
+ it { expect(last_email.to).to eq ['pirulo@mail.com'] }
78
+ it { expect(last_email.subject).to have_content 'Delete your Mumuki account' }
79
+ end
80
+
81
+ context 'adds a delete token to the user' do
82
+ it { expect(user.reload.delete_account_token).not_to be_nil }
83
+ end
84
+
85
+ context 'redirects to confirmation view' do
86
+ it { expect(response).to redirect_to(delete_request_user_path) }
87
+ end
88
+ end
70
89
  end
@@ -26,10 +26,16 @@ Rails.application.configure do
26
26
  config.cache_store = :null_store
27
27
  end
28
28
 
29
- # Don't care if the mailer can't send.
30
- config.action_mailer.perform_deliveries = false
29
+ config.reminder_sender_email = 'no-reply@mumuki.org'
30
+ config.support_email = 'soporte@mumuki.org'
31
+ config.disable_email = 'bajas@mumuki.org'
31
32
 
32
33
  config.action_mailer.perform_caching = false
34
+ config.action_mailer.raise_delivery_errors = false
35
+
36
+ # Settings for mailcatcher, run `mailcatcher` and go to http://localhost:1080/ to see which emails have been sent.
37
+ config.action_mailer.smtp_settings = { :address => '127.0.0.1', :port => 1025 }
38
+ config.action_mailer.delivery_method = :smtp
33
39
 
34
40
  # Print deprecation notices to the Rails logger.
35
41
  config.active_support.deprecation = :log
@@ -49,6 +49,9 @@ Rails.application.configure do
49
49
  credentials: {},
50
50
  info: {first_name: 'John', last_name: 'Doe', name: 'John Doe', nickname: 'johndoe'}
51
51
 
52
- config.reminder_sender_email = 'support@mumuki.org'
52
+ config.reminder_sender_email = 'no-reply@mumuki.org'
53
+ config.support_email = 'soporte@mumuki.org'
54
+ config.disable_email = 'bajas@mumuki.org'
55
+
53
56
  config.reminder_frequency = 7
54
57
  end
@@ -373,7 +373,6 @@ ActiveRecord::Schema.define(version: 20211020224011) do
373
373
  create_table "messages", id: :serial, force: :cascade do |t|
374
374
  t.string "submission_id"
375
375
  t.text "content"
376
- t.string "sender"
377
376
  t.datetime "date"
378
377
  t.datetime "created_at"
379
378
  t.datetime "updated_at"
@@ -389,6 +388,7 @@ ActiveRecord::Schema.define(version: 20211020224011) do
389
388
  t.bigint "assignment_id"
390
389
  t.bigint "sender_id"
391
390
  t.boolean "from_moderator"
391
+ t.bigint "sender_id"
392
392
  t.index ["approved_by_id"], name: "index_messages_on_approved_by_id"
393
393
  t.index ["assignment_id"], name: "index_messages_on_assignment_id"
394
394
  t.index ["deleted_by_id"], name: "index_messages_on_deleted_by_id"
@@ -1,10 +1,10 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  feature 'Dynamic Exam', organization_workspace: :test do
4
- let(:user) { create(:user, id: 1) }
4
+ let(:user) { create(:user, id: 5) }
5
5
  let(:user2) { create(:user, id: 2) }
6
6
 
7
- let!(:problem) { build(:problem, description: 'do f = $someVariable', randomizations: { someVariable: { type: :one_of, value: %w(some_string some_other_string)} }) }
7
+ let!(:problem) { build(:problem, description: 'do f = $someVariable', randomizations: { someVariable: { type: :one_of, value: %w(some_string some_other_string) } }) }
8
8
 
9
9
  let!(:chapter) {
10
10
  create(:chapter, lessons: [
@@ -30,7 +30,9 @@ feature 'Dynamic Exam', organization_workspace: :test do
30
30
  visit "/exercises/#{problem.transparent_id}"
31
31
 
32
32
  expect(page).to have_text('do f = some_other_string')
33
+ end
33
34
 
35
+ scenario 'visit exercise by transparent_id' do
34
36
  set_current_user! user2
35
37
  visit "/exercises/#{problem.transparent_id}"
36
38
 
@@ -113,7 +113,7 @@ feature 'Immersive redirection Flow', organization_workspace: :test, subdomain_r
113
113
  end
114
114
 
115
115
  def choose_organization(name)
116
- within '.modal' do
116
+ within '#organization-chooser-modal' do
117
117
  click_on "Go to #{name}"
118
118
  end
119
119
  end
@@ -40,6 +40,10 @@ class UserMailerPreview < ActionMailer::Preview
40
40
  UserMailer.notification notification
41
41
  end
42
42
 
43
+ def delete_account
44
+ UserMailer.delete_account user
45
+ end
46
+
43
47
  private
44
48
 
45
49
  def exam_registration
@@ -68,7 +68,7 @@ RSpec.describe UserMailer, type: :mailer do
68
68
  it "renders the headers" do
69
69
  expect(reminder.subject).to eq("We miss you!")
70
70
  expect(reminder.to).to eq([user.email])
71
- expect(reminder.from).to eq(["support@mumuki.org"])
71
+ expect(reminder.from).to eq(["no-reply@mumuki.org"])
72
72
  end
73
73
 
74
74
  context 'last reminded over 1 week ago' do
@@ -134,7 +134,7 @@ RSpec.describe UserMailer, type: :mailer do
134
134
  it "renders the headers" do
135
135
  expect(reminder.subject).to eq("Start using Mumuki!")
136
136
  expect(reminder.to).to eq([user.email])
137
- expect(reminder.from).to eq(["support@mumuki.org"])
137
+ expect(reminder.from).to eq(["no-reply@mumuki.org"])
138
138
  end
139
139
 
140
140
  context 'last reminded over 1 week ago' do
@@ -189,7 +189,7 @@ RSpec.describe UserMailer, type: :mailer do
189
189
  it { expect(email.body.encoded).to eq 'hello some name!' }
190
190
 
191
191
  context 'when organization does not have a custom sender address' do
192
- it { expect(email.from).to eq ['support@mumuki.org'] }
192
+ it { expect(email.from).to eq ['no-reply@mumuki.org'] }
193
193
  end
194
194
 
195
195
  context 'when organization does not have a custom sender address' do
@@ -198,4 +198,11 @@ RSpec.describe UserMailer, type: :mailer do
198
198
  it { expect(email.from).to eq ['info@mumuki.org'] }
199
199
  end
200
200
  end
201
+
202
+ describe 'delete account email' do
203
+ let(:user) { create(:user, delete_account_token: 'SecreT1234', last_organization: central) }
204
+ let(:email) { UserMailer.delete_account(user) }
205
+
206
+ it { expect(email.body.encoded).to include 'central.localmumuki.io/user/delete_confirmation?token=SecreT1234' }
207
+ end
201
208
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mumuki-laboratory
3
3
  version: !ruby/object:Gem::Version
4
- version: 9.22.0
4
+ version: 9.23.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Franco Bulgarelli
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-11-04 00:00:00.000000000 Z
11
+ date: 2021-11-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 9.22.0
33
+ version: 9.23.0
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: 9.22.0
40
+ version: 9.23.0
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: mumukit-bridge
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -290,6 +290,26 @@ dependencies:
290
290
  - - "~>"
291
291
  - !ruby/object:Gem::Version
292
292
  version: '3.7'
293
+ - !ruby/object:Gem::Dependency
294
+ name: mini_racer
295
+ requirement: !ruby/object:Gem::Requirement
296
+ requirements:
297
+ - - ">="
298
+ - !ruby/object:Gem::Version
299
+ version: '0.4'
300
+ - - "<"
301
+ - !ruby/object:Gem::Version
302
+ version: '0.5'
303
+ type: :runtime
304
+ prerelease: false
305
+ version_requirements: !ruby/object:Gem::Requirement
306
+ requirements:
307
+ - - ">="
308
+ - !ruby/object:Gem::Version
309
+ version: '0.4'
310
+ - - "<"
311
+ - !ruby/object:Gem::Version
312
+ version: '0.5'
293
313
  - !ruby/object:Gem::Dependency
294
314
  name: wkhtmltopdf-binary
295
315
  requirement: !ruby/object:Gem::Requirement
@@ -554,6 +574,7 @@ files:
554
574
  - app/helpers/icons_helper.rb
555
575
  - app/helpers/kindergarten_helper.rb
556
576
  - app/helpers/links_helper.rb
577
+ - app/helpers/mailer_helper.rb
557
578
  - app/helpers/medal_helper.rb
558
579
  - app/helpers/menu_bar_helper.rb
559
580
  - app/helpers/messages_helper.rb
@@ -713,6 +734,7 @@ files:
713
734
  - app/views/user_mailer/_mail_template.erb
714
735
  - app/views/user_mailer/certificate.html.erb
715
736
  - app/views/user_mailer/certificate.text.erb
737
+ - app/views/user_mailer/delete_account.html.erb
716
738
  - app/views/user_mailer/no_submissions_reminder.html.erb
717
739
  - app/views/user_mailer/no_submissions_reminder.text.erb
718
740
  - app/views/user_mailer/notification.html.erb
@@ -728,9 +750,14 @@ files:
728
750
  - app/views/users/_edit_user_form.html.erb
729
751
  - app/views/users/_profile_fields.html.erb
730
752
  - app/views/users/_term.html.erb
753
+ - app/views/users/_user_delete_confirmation.erb
754
+ - app/views/users/_user_delete_modal.html.erb
731
755
  - app/views/users/_user_form.html.erb
732
756
  - app/views/users/activity.html.erb
733
757
  - app/views/users/certificates.html.erb
758
+ - app/views/users/delete_account.html.erb
759
+ - app/views/users/delete_confirmation_invalid.html.erb
760
+ - app/views/users/delete_request.html.erb
734
761
  - app/views/users/discussions.html.erb
735
762
  - app/views/users/edit.html.erb
736
763
  - app/views/users/exam_authorizations.html.erb
@@ -857,7 +884,6 @@ files:
857
884
  - spec/features/certificate_programs_flow_spec.rb
858
885
  - spec/features/chapters_flow_spec.rb
859
886
  - spec/features/complements_flow_spec.rb
860
- - spec/features/disable_user_flow_spec.rb
861
887
  - spec/features/disabled_organization_flow_spec.rb
862
888
  - spec/features/discussion_flow_spec.rb
863
889
  - spec/features/dynamic_exam_spec.rb
@@ -1069,7 +1095,6 @@ test_files:
1069
1095
  - spec/features/chapters_flow_spec.rb
1070
1096
  - spec/features/profile_flow_spec.rb
1071
1097
  - spec/features/dynamic_exam_spec.rb
1072
- - spec/features/disable_user_flow_spec.rb
1073
1098
  - spec/features/immersive_redirection_spec.rb
1074
1099
  - spec/features/disabled_organization_flow_spec.rb
1075
1100
  - spec/features/invitations_flow_spec.rb
@@ -1,32 +0,0 @@
1
- require 'spec_helper'
2
-
3
- feature 'disable user flow', organization_workspace: :test do
4
- let!(:current_organization) { Organization.current }
5
- let(:user) { create(:user) }
6
-
7
- let!(:chapter) {
8
- create(:chapter, lessons: [
9
- create(:lesson, guide: create(:guide))]) }
10
-
11
- let(:book) { current_organization.book }
12
-
13
- before { reindex_current_organization! }
14
-
15
- before { set_current_user! user }
16
-
17
- scenario 'enabled visitor' do
18
- visit '/'
19
-
20
- expect(page_body).to have_text(current_organization.book.name)
21
- expect(user.reload.last_organization).to eq current_organization
22
- end
23
-
24
- scenario 'disable visitor' do
25
- user.disable!
26
-
27
- visit '/'
28
-
29
- expect(page_body).to_not have_text(current_organization.book.name)
30
- expect(page_body).to have_text('You are trying to visit a permamently disabled or deleted resource')
31
- end
32
- end