diff --git a/lib/mumuki/laboratory/controllers/dynamic_errors.rb b/lib/mumuki/laboratory/controllers/dynamic_errors.rb index 730302c01..2a1f426db 100644 --- a/lib/mumuki/laboratory/controllers/dynamic_errors.rb +++ b/lib/mumuki/laboratory/controllers/dynamic_errors.rb @@ -14,6 +14,7 @@ module Mumuki::Laboratory::Controllers::DynamicErrors rescue_from Mumuki::Domain::UnauthorizedError, with: :unauthorized rescue_from Mumuki::Domain::GoneError, with: :gone rescue_from Mumuki::Domain::BlockedForumError, with: :blocked_forum + rescue_from Mumuki::Domain::DisabledError, with: :disabled rescue_from ActiveRecord::RecordInvalid, with: :bad_record end @@ -41,6 +42,10 @@ def forbidden render_error 'forbidden', 403, locals: { explanation: :forbidden_explanation }, error_message: message end + def disabled + render_error 'forbidden', 403, locals: { explanation: :disabled_explanation } + end + def blocked_forum render_error 'forbidden', 403, locals: { explanation: :blocked_forum_explanation } end diff --git a/lib/mumuki/laboratory/locales/en.yml b/lib/mumuki/laboratory/locales/en.yml index 6d4675c6f..2cef26501 100644 --- a/lib/mumuki/laboratory/locales/en.yml +++ b/lib/mumuki/laboratory/locales/en.yml @@ -54,8 +54,9 @@ en: created_at: Created at date: Date description: Description - destroy: Destroy destroy_message: delete the message + destroy: Destroy + disabled_explanation: You are trying to visit a permamently disabled or deleted resource discussion_updated: Discussion updated discussions: Discussions dont_leave_us: Don't leave us! Learning is fun. You just have to keep at it. diff --git a/lib/mumuki/laboratory/locales/es.yml b/lib/mumuki/laboratory/locales/es.yml index 4607b2724..aef3f3a45 100644 --- a/lib/mumuki/laboratory/locales/es.yml +++ b/lib/mumuki/laboratory/locales/es.yml @@ -60,9 +60,10 @@ es: day: Día days: Días description: Descripción - destroy: Eliminar destroy_message: eliminar el mensaje + destroy: Eliminar details: Detalles + disabled_explanation: Estás intentando acceder a un recurso que fue deshabilitado o eliminado de forma permamente discussion_updated: Consulta actualizada discussions: Consultas dont_leave_us: ¡No nos abandones! Aprender a programar es divertido. Sólo tenés que seguir practicando. diff --git a/lib/mumuki/laboratory/locales/pt.yml b/lib/mumuki/laboratory/locales/pt.yml index db4a8b3af..c590d5ec5 100644 --- a/lib/mumuki/laboratory/locales/pt.yml +++ b/lib/mumuki/laboratory/locales/pt.yml @@ -57,9 +57,10 @@ pt: day: Dia days: Dias description: Descrição - destroy: Excluir destroy_message: excluir a mensagem + destroy: Excluir details: Detalhes + disabled_explanation: Você está tentando acessar um recurso que foi desativado ou removido permanentemente discussion_updated: Consulta actualizada discussions: Consultas download: Faça o download do que você fez diff --git a/spec/features/disable_user_flow_spec.rb b/spec/features/disable_user_flow_spec.rb index 849d2d974..c5c1a8757 100644 --- a/spec/features/disable_user_flow_spec.rb +++ b/spec/features/disable_user_flow_spec.rb @@ -29,6 +29,6 @@ expect(page).to_not have_text('ム mumuki') expect(page).to_not have_text(current_organization.book.name) - expect(page).to have_text('You are not allowed to see this content') + expect(page).to have_text('You are trying to visit a permamently disabled or deleted resource') end end