mumuki-laboratory 9.1.0 → 9.3.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/app/assets/javascripts/mumuki_laboratory/application/profile.js +7 -15
  3. data/app/assets/stylesheets/mumuki_laboratory/application/modules/_breadcrumb.scss +4 -28
  4. data/app/assets/stylesheets/mumuki_laboratory/application/modules/_kids.scss +0 -1
  5. data/app/controllers/concerns/organizations_controller_template.rb +1 -0
  6. data/app/controllers/exam_authorization_requests_controller.rb +1 -5
  7. data/app/controllers/users_controller.rb +4 -0
  8. data/app/helpers/profile_helper.rb +1 -1
  9. data/app/helpers/user_menu_helper.rb +4 -0
  10. data/app/views/exam_authorization_requests/_approved.html.erb +1 -0
  11. data/app/views/exam_authorization_requests/_pending.html.erb +4 -0
  12. data/app/views/exam_authorization_requests/_rejected.html.erb +1 -0
  13. data/app/views/exam_registrations/show.html.erb +1 -1
  14. data/app/views/layouts/_kids.html.erb +2 -2
  15. data/app/views/layouts/_main.html.erb +1 -1
  16. data/app/views/layouts/_test_results.html.erb +1 -1
  17. data/app/views/layouts/_user_menu.html.erb +1 -0
  18. data/app/views/layouts/application.html.erb +1 -1
  19. data/app/views/notifications/_exam_authorization_request.html.erb +1 -1
  20. data/app/views/users/exam_authorizations.html.erb +42 -0
  21. data/config/routes.rb +2 -1
  22. data/lib/mumuki/laboratory/locales/en.yml +3 -1
  23. data/lib/mumuki/laboratory/locales/es-CL.yml +3 -1
  24. data/lib/mumuki/laboratory/locales/es.yml +3 -1
  25. data/lib/mumuki/laboratory/locales/pt.yml +3 -1
  26. data/lib/mumuki/laboratory/version.rb +1 -1
  27. data/spec/controllers/exam_authorization_requests_controller_spec.rb +1 -18
  28. data/spec/controllers/organizations_api_controller_spec.rb +3 -1
  29. data/spec/controllers/users_controller_spec.rb +1 -0
  30. data/spec/features/notifications_flow_spec.rb +2 -3
  31. data/spec/features/profile_flow_spec.rb +2 -9
  32. data/spec/helpers/with_navigation_spec.rb +15 -0
  33. metadata +119 -116
  34. data/app/views/exam_authorization_requests/show.html.erb +0 -17
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 42ddcb38b3d3ff241bc81dd9b18c22afaf7a2078d3064e5e9e888155b3e16226
4
- data.tar.gz: 0b244643dd954e25ca038c79d71fb79cf58a5bffd915d8824ac72ccaf49a920d
3
+ metadata.gz: 7fcf8057854fbb65bd0ddb801770c0d7a9de320735217bb50ac239d3c303651d
4
+ data.tar.gz: 6466a0bfca548fce3eb105daa98b9f9790616ad0009928efd7c46719fc9526d7
5
5
  SHA512:
6
- metadata.gz: 52ec0f9e2703a88efe4949706020b6bb83516252ab389faecd8c838ce6094faa40149bdb7d5573d95b9ad9e6d7909bd0b3f03cd0f3787925f6e37eebfd5bed6b
7
- data.tar.gz: 6b7412a1b79947d6426f43edb5f5c50163671658227281aa94676b77abf870f1695925310a64dfa5a9d37f13f797dd4f96587c19922c28f8d043dd6c7982d708
6
+ metadata.gz: fe7ff6eb305b615a33cea3d90be11d06b58acbeb7e6e6add7049bf632055d676e6a9cc475c88649a8341ca8038fe7d8b6ce7b8616ceef1a6d3094bdffba75422
7
+ data.tar.gz: d7fba0d3d8a4e3223efc8987649a482794be90958d5e6b618b4bce519e72b72b7e42cddaecf8f4f151ca864a8caa9a4b18369abe2c281c5c5d9e9cba99ca4f6a
@@ -9,11 +9,10 @@ mumuki.load(function() {
9
9
  let avatarId = "";
10
10
  let avatarType = "";
11
11
 
12
- let originalData = $userForm.serialize();
13
- let originalProfilePicture = $userAvatar.attr('src');
12
+ toggleEditButtonIfRequiredFieldsNotCompleted();
14
13
 
15
14
  $userForm.on('change keyup', function() {
16
- toggleEditButtonIfThereAreChanges();
15
+ toggleEditButtonIfRequiredFieldsNotCompleted();
17
16
  });
18
17
 
19
18
  $avatarItem.on('keypress click', function(e) {
@@ -25,26 +24,19 @@ mumuki.load(function() {
25
24
  const clickedAvatarType = $(this).attr('type');
26
25
  avatarId = clickedAvatarId || "";
27
26
  avatarType = clickedAvatarType || "";
28
-
29
- toggleEditButtonIfThereAreChanges();
30
27
  });
31
28
  });
32
29
 
33
- function toggleEditButtonIfThereAreChanges() {
34
- let shouldEnable = requiredFieldsAreFilled() && (dataChanged() || avatarChanged());
35
-
36
- $editButton.prop('disabled', !shouldEnable);
30
+ function toggleEditButtonIfRequiredFieldsNotCompleted() {
31
+ $editButton.prop('disabled', !requiredFieldsAreCompleted());
37
32
  }
38
33
 
39
- const requiredFieldsAreFilled = () =>
40
- $userForm.find('select, textarea, input').toArray().every(elem => {
34
+ function requiredFieldsAreCompleted() {
35
+ return $userForm.find('select, textarea, input').toArray().every(elem => {
41
36
  const $elem = $(elem);
42
37
  return !($elem.prop('required')) || !!$elem.val();
43
38
  });
44
-
45
- const dataChanged = () => $userForm.serialize() !== originalData;
46
-
47
- const avatarChanged = () => $userAvatar.attr('src') !== originalProfilePicture;
39
+ }
48
40
 
49
41
  $('#mu-user-image').on('keypress click', function(e){
50
42
  onClickOrSpacebarOrEnter($(this), e, function() {
@@ -22,34 +22,6 @@
22
22
 
23
23
  }
24
24
 
25
- .hamburguer-breadcrumb {
26
- .hamburguer {
27
- font-size: 2.5rem;
28
- cursor: pointer;
29
- }
30
- li {
31
- a {
32
- padding: 15px;
33
- }
34
- &:first-child {
35
- i {
36
- &:before {
37
- font-family: 'dev-awesome', serif;
38
- content: "\f10b";
39
- }
40
- &:after {
41
- font-family: 'Lato', serif;
42
- content: "mumuki";
43
- padding: 5px;
44
- }
45
- }
46
- }
47
- &:last-child {
48
- display: none;
49
- }
50
- }
51
- }
52
-
53
25
  .mu-navbar-avatar {
54
26
  justify-self: flex-end;
55
27
  .rounded-circle {
@@ -61,4 +33,8 @@
61
33
  object-fit: contain;
62
34
  height: 38px;
63
35
  position: relative;
36
+
37
+ @include media-breakpoint-down(lg) {
38
+ max-width: 70vw;
39
+ }
64
40
  }
@@ -195,7 +195,6 @@ $kids-speech-tabs-width: 40px;
195
195
  .mu-kids-next-speech {
196
196
  position: absolute;
197
197
  right: $kids-speech-tabs-width;
198
- font-size: 90%;
199
198
  color: darken($mu-color-disabled, 25%);
200
199
  &:hover {
201
200
  cursor: pointer;
@@ -26,6 +26,7 @@ module OrganizationsControllerTemplate
26
26
  .require(:organization)
27
27
  .permit(:book,
28
28
  :name,
29
+ :faqs,
29
30
  *Mumuki::Domain::Organization::Profile.attributes,
30
31
  *Mumuki::Domain::Organization::Theme.attributes,
31
32
  *(Mumuki::Domain::Organization::Settings.attributes - [:login_methods]),
@@ -1,13 +1,9 @@
1
1
  class ExamAuthorizationRequestsController < ApplicationController
2
- def show
3
- @authorization_request = ExamAuthorizationRequest.find(params[:id])
4
- current_user.read_notification! @authorization_request
5
- end
6
-
7
2
  def create
8
3
  authorization_request = ExamAuthorizationRequest.create! authorization_request_params
9
4
  current_user.read_notification! authorization_request.exam_registration
10
5
  flash.notice = I18n.t :exam_authorization_request_created
6
+ redirect_to root_path
11
7
  end
12
8
 
13
9
  def update
@@ -38,6 +38,10 @@ class UsersController < ApplicationController
38
38
  @certificates ||= current_user.certificates_in_organization
39
39
  end
40
40
 
41
+ def exam_authorizations
42
+ @exam_authorization_requests ||= ExamAuthorizationRequest.where(user: current_user, organization: Organization.current)
43
+ end
44
+
41
45
  def unsubscribe
42
46
  user_id = User.unsubscription_verifier.verify(params[:id])
43
47
  User.find(user_id).unsubscribe_from_reminders!
@@ -8,6 +8,6 @@ module ProfileHelper
8
8
  end
9
9
 
10
10
  def save_edit_profile_button(form)
11
- form.submit t(:save), disabled: true, class: 'btn btn-complementary mu-edit-profile-btn'
11
+ form.submit t(:save), class: 'btn btn-complementary mu-edit-profile-btn'
12
12
  end
13
13
  end
@@ -27,6 +27,10 @@ module UserMenuHelper
27
27
  user_menu_item t(:certificates), certificates_user_path, 'certificates'
28
28
  end
29
29
 
30
+ def exam_authorizations_user_menu_link
31
+ user_menu_item t(:exams), exam_authorizations_user_path, 'exam_authorizations'
32
+ end
33
+
30
34
  private
31
35
 
32
36
  def user_menu_item(label, path, active_on)
@@ -0,0 +1 @@
1
+ <%= t :exam_authorization_request_approved_html, date: l(authorization_request.exam.start_time, format: :long) %>
@@ -0,0 +1,4 @@
1
+ <%= t :exam_authorization_pending_explanation_html,
2
+ date: l(authorization_request.exam.start_time, format: :long),
3
+ end_time: l(authorization_request.exam_registration.end_time, format: :long),
4
+ edit_path: url_for(authorization_request.exam_registration) %>
@@ -0,0 +1 @@
1
+ <%= t :exam_authorization_request_rejected %>
@@ -11,7 +11,7 @@
11
11
  </div>
12
12
 
13
13
  <div class="row">
14
- <div class="mu-inline-block-left">
14
+ <div class="col-lg-12">
15
15
  <div class="bs-callout bs-callout-info">
16
16
  <h4 class="text-info">
17
17
  <strong><%= fa_icon :info_circle %> <%= t :important_info %></strong>
@@ -12,8 +12,8 @@
12
12
  </ul>
13
13
  <% end %>
14
14
  <div class="mu-kids-character-speech-bubble-normal">
15
- <i class="mu-kids-prev-speech fas fa-fw fa-caret-up"></i>
16
- <i class="mu-kids-next-speech fas fa-fw fa-caret-down"></i>
15
+ <i class="mu-kids-prev-speech fas fa-fw fa-lg fa-caret-up"></i>
16
+ <i class="mu-kids-next-speech fas fa-fw fa-lg fa-caret-down"></i>
17
17
  <div class="description"><%= exercise.description_task %></div>
18
18
  <div class="hint"><%= exercise.hint_html %></div>
19
19
  </div>
@@ -28,7 +28,7 @@
28
28
 
29
29
  <%= yield :navbar %>
30
30
 
31
- <div class="<%= exercise_container_type %><%= @kids ? '-fluid' : '' %> mb-5" id="wrap">
31
+ <div class="<%= exercise_container_type %><%= ' mb-5' unless input_kids? %>" id="wrap">
32
32
  <div class="toast-container bottom-0 start-0 p-3">
33
33
  <% if notice %>
34
34
  <%= toast_notice(notice) %>
@@ -23,7 +23,7 @@
23
23
  </span>
24
24
  <% end %>
25
25
 
26
- <div class="example-result collapse <%= 'in' if contextualization.visible_success_output? %>" id="example-result-<%= index %>">
26
+ <div class="example-result collapse <%= 'show' if contextualization.visible_success_output? %>" id="example-result-<%= index %>">
27
27
  <%= contextualization.test_result_html test_result %>
28
28
  </div>
29
29
  </li>
@@ -10,6 +10,7 @@
10
10
  <%= user_menu_divider %>
11
11
  <%= activity_user_menu_link %>
12
12
  <%= certificates_user_menu_link %>
13
+ <%= exam_authorizations_user_menu_link %>
13
14
  </div>
14
15
  </div>
15
16
  <div class="mu-user-menu-divider vertical d-none d-md-block"></div>
@@ -3,7 +3,7 @@
3
3
  <div class="<%= exercise_container_type %> px-0">
4
4
  <nav class="navbar navbar-light navbar-expand-lg mu-navbar">
5
5
  <div class="container-fluid">
6
- <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#muNavbar" aria-controls="muNavbar" aria-expanded="false" aria-label="Toggle navigation">
6
+ <button class="navbar-toggler collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#muNavbar" aria-controls="muNavbar" aria-expanded="false" aria-label="Toggle navigation">
7
7
  <span class="navbar-toggler-icon"></span>
8
8
  </button>
9
9
  <div class="mu-navbar-avatar order-lg-2">
@@ -1 +1 @@
1
- <%= menu_item :book_open, :exam_authorization_request_updated, url_for(target), { description: target.exam_registration.description } %>
1
+ <%= menu_item :book_open, :exam_authorization_request_updated, exam_authorizations_user_path, { description: target.exam_registration.description } %>
@@ -0,0 +1,42 @@
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
+ <div class="mu-user-header">
10
+ <h1><%= t(:exam_registrations) %></h1>
11
+ </div>
12
+ <% if @exam_authorization_requests.empty? %>
13
+ <div class="mu-tab-body">
14
+ <%= t :exams_will_be_here %>
15
+ </div>
16
+ <% else %>
17
+ <div class="col-md-12">
18
+ <div class="accordion" id="exam_authorization_accordion">
19
+ <% @exam_authorization_requests.each_with_index do |it, index| %>
20
+ <div class="accordion-item">
21
+ <h2 class="accordion-header" id="<%= "exam_authorization_accordion_item_#{index}" %>">
22
+ <button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#<%= "exam_authorization_collapse_item_#{index}" %>" aria-expanded="false" aria-controls="<%= "exam_authorization_collapse_item_#{index}" %>">
23
+ <span class="fa fa-fw fa-<%= it.icon[:class] %> text-<%= it.icon[:type] %>" data-bs-toggle="tooltip" title="<%= t(it.status).humanize %>"></span>
24
+ <span class="divider-vertical"></span>
25
+ <span><strong><%= it.exam_registration.description %></strong> - <small><%= l(it.exam.start_time, format: :long) %></small></span>
26
+ </button>
27
+ </h2>
28
+ <div id="<%= "exam_authorization_collapse_item_#{index}" %>" class="accordion-collapse collapse" aria-labelledby="<%= "exam_authorization_accordion_item_#{index}" %>" data-bs-parent="#exam_authorization_accordion">
29
+ <div class="accordion-body p-0">
30
+ <div class="m-0 border-bottom-0 border-top-0 border-right-0 bs-callout bs-callout-<%= it.icon[:type] %>">
31
+ <p><%= render partial: "exam_authorization_requests/#{it.status}", locals: { authorization_request: it } %></p>
32
+ </div>
33
+ </div>
34
+ </div>
35
+ </div>
36
+ <% end %>
37
+ </div>
38
+
39
+ </div>
40
+ <% end %>
41
+ </div>
42
+ </div>
data/config/routes.rb CHANGED
@@ -24,7 +24,7 @@ Rails.application.routes.draw do
24
24
  get '/discussions/messages/preview', to: 'discussions_messages#preview', as: :preview_discussion_message
25
25
 
26
26
  resources :exam_registrations, only: [:show]
27
- resources :exam_authorization_requests, only: [:show, :create, :update]
27
+ resources :exam_authorization_requests, only: [:create, :update]
28
28
 
29
29
  resources :book, only: [:show]
30
30
  resources :chapters, only: [:show] do
@@ -68,6 +68,7 @@ Rails.application.routes.draw do
68
68
  get :discussions
69
69
  get :activity
70
70
  get :certificates
71
+ get :exam_authorizations
71
72
 
72
73
  end
73
74
 
@@ -108,15 +108,17 @@ en:
108
108
  error_500: 500 error
109
109
  error_description: This is known as a <span class="error-link">%{error}</span>.
110
110
  errored: Oops, your solution didn't work
111
+ exam_authorization_pending_explanation_html: You have until <strong>%{end_time}</strong> to register. After that date, your request will be processed and you will receive a confirmation. <br> Don't forget to check the notifications!
111
112
  exam_authorization_request_approved_html: Your request was approved, don't forget to log in at <strong>%{date}</strong>. Good luck!
112
113
  exam_authorization_request_created: Your registration to the exam has been saved!
113
- exam_authorization_request_rejected: Your request was rejected.
114
+ exam_authorization_request_rejected: Your request was rejected because you didn't meet the requirements.
114
115
  exam_authorization_request_saved: Your registration to the exam has been updated!
115
116
  exam_authorization_request_updated: Your registration to %{description} has been updated
116
117
  exam_registration_choose_exam: Choose date and time to attend to the exam
117
118
  exam_registration_explanation_html: You have until <strong>%{date}</strong> to register. After that date, your request will be processed and you will receive a confirmation. <br> Don't forget to check the notifications!
118
119
  exam_registration_open: Registrations open for %{description}!
119
120
  exam_registration_to: Registration to %{description}
121
+ exams_will_be_here: Your exams in the organization will appear here.
120
122
  exams: Exams
121
123
  exercise: Exercise
122
124
  exercises: Exercises
@@ -108,15 +108,17 @@ es-CL:
108
108
  internal_server_error: ¡Ups! Algo no anduvo bien
109
109
  not_found: ¡Ups! La página no existe
110
110
  errored: ¡Ups! Tu solución no se puede ejecutar
111
+ exam_authorization_pending_explanation_html: Tienes tiempo hasta el <strong>%{end_time}</strong> para inscribirte. Pasada esa fecha, tu solicitud será evaluada y recibirás una confirmación. <br> ¡No olvides revisar las notificaciones!
111
112
  exam_authorization_request_approved_html: Tu solicitud fue aprobada, no olvides conectarte el <strong>%{date}</strong>. ¡Buena suerte!
112
113
  exam_authorization_request_created: ¡Tu inscripción al exámen se registró exitosamente!
113
- exam_authorization_request_rejected: Tu solicitud fue rechazada.
114
+ exam_authorization_request_rejected: Tu solicitud fue rechazada porque no cumpliste con los requisitos para rendir el examen.
114
115
  exam_authorization_request_saved: ¡Tu inscripción al exámen se modificó exitosamente!
115
116
  exam_authorization_request_updated: Hay novedades sobre tu inscripción a %{description}
116
117
  exam_registration_choose_exam: Seleccioná día y horario en el que te gustaría rendir el exámen
117
118
  exam_registration_explanation_html: Tienes tiempo hasta el <strong>%{date}</strong> para inscribirte. Pasada esa fecha, tu solicitud será evaluada y recibirás una confirmación. <br> ¡No olvides revisar las notificaciones!
118
119
  exam_registration_open: ¡Ya puedes inscribirte a %{description}!
119
120
  exam_registration_to: Inscripción a %{description}
121
+ exams_will_be_here: Tus exámenes en esta organización aparecerán acá
120
122
  exams: Exámenes
121
123
  exercise: Ejercicio
122
124
  exercise_count: ejercicios
@@ -116,15 +116,17 @@ es:
116
116
  internal_server_error: ¡Ups! Algo no anduvo bien
117
117
  not_found: ¡Ups! La página no existe
118
118
  errored: ¡Ups! Tu solución no se puede ejecutar
119
+ exam_authorization_pending_explanation_html: Tenés tiempo hasta el <strong>%{end_time}</strong> para cambiar el turno haciendo click <strong><a href="%{edit_path}">acá</a></strong>. Pasada esa fecha, tu solicitud será evaluada y recibirás una confirmación. <br> ¡No te olvides de revisar las notificaciones!
119
120
  exam_authorization_request_approved_html: Tu solicitud fue aprobada, no olvides conectarte el <strong>%{date}</strong>. ¡Buena suerte!
120
121
  exam_authorization_request_created: ¡Tu inscripción al exámen se registró exitosamente!
121
- exam_authorization_request_rejected: Tu solicitud fue rechazada.
122
+ exam_authorization_request_rejected: Tu solicitud fue rechazada porque no cumpliste con los requisitos para rendir el examen.
122
123
  exam_authorization_request_saved: ¡Tu inscripción al exámen se modificó exitosamente!
123
124
  exam_authorization_request_updated: Hay novedades sobre tu inscripción a %{description}
124
125
  exam_registration_choose_exam: Seleccioná día y horario en el que te gustaría rendir el exámen
125
126
  exam_registration_explanation_html: Tenés tiempo hasta el <strong>%{date}</strong> para inscribirte. Pasada esa fecha, tu solicitud será evaluada y recibirás una confirmación. <br> ¡No te olvides de revisar las notificaciones!
126
127
  exam_registration_open: ¡Ya podés inscribirte a %{description}!
127
128
  exam_registration_to: Inscripción a %{description}
129
+ exams_will_be_here: Tus exámenes en esta organización aparecerán acá
128
130
  exams: Exámenes
129
131
  exercise: Ejercicio
130
132
  exercise_count: ejercicios
@@ -111,15 +111,17 @@ pt:
111
111
  error_500: erro 500
112
112
  error_description: Isto é o que é conhecido como <span class = "error-link"> %{error} </ span>.
113
113
  errored: Opa! Sua solução não pode ser executada
114
+ exam_authorization_pending_explanation_html: Você tem tempo até <strong>%{date}</strong> para se inscrever. Após essa data, sua inscrição será avaliada e você receberá uma confirmação. <br> Não se esqueça de verificar as notificações!
114
115
  exam_authorization_request_approved_html: Sua solicitação foi aprovada, não se esqueça de conectar em <strong>%{date}</strong>. Boa sorte!
115
116
  exam_authorization_request_created: Seu registro de exame foi salvo com sucesso!
116
- exam_authorization_request_rejected: Seu pedido foi rejeitado.
117
+ exam_authorization_request_rejected: Sua solicitação foi rejeitada porque você não atendeu aos requisitos.
117
118
  exam_authorization_request_saved: Seu registro de exame foi modificado com sucesso!
118
119
  exam_authorization_request_updated: Há notícias sobre seu registro para %{description}
119
120
  exam_registration_choose_exam: Selecione o dia e a hora em que gostaria de fazer o exame
120
121
  exam_registration_explanation_html: Você tem tempo até <strong>%{date}</strong> para se inscrever. Após essa data, sua inscrição será avaliada e você receberá uma confirmação. <br> Não se esqueça de verificar as notificações!
121
122
  exam_registration_open: "¡Inscrições abertas para %{description}!"
122
123
  exam_registration_to: Inscrição a %{description}
124
+ exams_will_be_here: Seus Examesca nesta organização aparecerão aqui
123
125
  exams: Examesca
124
126
  exercise: Exercício
125
127
  exercise_count: exercícios
@@ -1,5 +1,5 @@
1
1
  module Mumuki
2
2
  module Laboratory
3
- VERSION = '9.1.0'
3
+ VERSION = '9.3.0'
4
4
  end
5
5
  end
@@ -7,23 +7,6 @@ describe ExamAuthorizationRequestsController, type: :controller, organization_wo
7
7
 
8
8
  before { set_current_user! user }
9
9
 
10
- describe 'show' do
11
- context 'when authorization does not exist' do
12
- before { get :show, params: {id: 0} }
13
- it { expect(response.status).to eq 404 }
14
- end
15
-
16
- context 'when authorization exists' do
17
- let(:exam_authorization_request) { create(:exam_authorization_request, user: user, exam_registration: exam_registration) }
18
- let!(:notification) { create(:notification, target: exam_authorization_request, user: user) }
19
-
20
- before { get :show, params: {id: exam_authorization_request.id} }
21
-
22
- it { expect(response.status).to eq 200 }
23
- it { expect(notification.reload.read).to be_truthy }
24
- end
25
- end
26
-
27
10
  describe 'create' do
28
11
  let!(:notification) { create(:notification, target: exam_registration, user: user) }
29
12
 
@@ -33,7 +16,7 @@ describe ExamAuthorizationRequestsController, type: :controller, organization_wo
33
16
  }
34
17
  end
35
18
 
36
- it { expect(response.status).to eq 204 }
19
+ it { expect(response.status).to eq 302 }
37
20
  it { expect(exam_registration.authorization_requests.length).to be 1 }
38
21
  it { expect(notification.reload.read).to be_truthy }
39
22
  end
@@ -143,7 +143,8 @@ describe Api::OrganizationsController, type: :controller, organization_workspace
143
143
  logo_url: 'http://a-logo-url.com',
144
144
  theme_stylesheet: '.theme { color: red }',
145
145
  extension_javascript: 'window.a = function() { }',
146
- terms_of_service: 'A TOS'}
146
+ terms_of_service: 'A TOS',
147
+ faqs: 'some faqs'}
147
148
  end
148
149
 
149
150
  it { expect(organization.public?).to eq false }
@@ -153,6 +154,7 @@ describe Api::OrganizationsController, type: :controller, organization_workspace
153
154
  it { expect(organization.theme_stylesheet).to eq ".theme { color: red }" }
154
155
  it { expect(organization.extension_javascript).to eq "window.a = function() { }" }
155
156
  it { expect(organization.terms_of_service).to eq 'A TOS' }
157
+ it { expect(organization.faqs).to eq 'some faqs' }
156
158
  end
157
159
 
158
160
  context 'with missing values' do
@@ -18,4 +18,5 @@ describe UsersController, type: :controller, organization_workspace: :test do
18
18
  it { expect(User.last.first_name).to eq 'foo' }
19
19
  it { expect(User.last.verified_first_name).to be_nil }
20
20
  end
21
+
21
22
  end
@@ -37,10 +37,9 @@ feature 'Notifications Flow', organization_workspace: :test do
37
37
  expect(page).to have_text 'Choose date and time to attend to the exam'
38
38
  end
39
39
 
40
- scenario 'removes notification after target is processed' do
41
- # Notification for exam authorization request is considered read after user click
40
+ scenario 'does not remove exam authorization notification after click it ' do
42
41
  find_notification_number(1).click
43
- expect(notifications_bell).to have_text('1')
42
+ expect(notifications_bell).to have_text('2')
44
43
  end
45
44
  end
46
45
  end
@@ -73,19 +73,12 @@ feature 'Profile Flow', organization_workspace: :test do
73
73
  context 'user with uncompleted profile after saving' do
74
74
  before { user.update! last_name: 'last_name', birthdate: Time.now - 20.years, gender: 'female' }
75
75
 
76
- let(:button_options) do
77
- # Match :first is used because there are two buttons: mobile and desktop.
78
- { class: 'mu-edit-profile-btn', match: :first }.tap do |options|
79
- options.merge!(disabled: true) unless run_with_selenium?
80
- end
81
- end
82
-
83
76
  context 'when visiting an exercise' do
84
77
  scenario 'is redirected to previous path' do
85
78
  visit "/exercises/#{exercise.transparent_id}"
86
79
  fill_in('user_first_name', with: 'first_name')
87
80
 
88
- click_on(button_options)
81
+ click_on(class: 'mu-edit-profile-btn', match: :first)
89
82
  expect(page).to have_text(exercise.description)
90
83
  end
91
84
  end
@@ -95,7 +88,7 @@ feature 'Profile Flow', organization_workspace: :test do
95
88
  visit "/user/edit"
96
89
  fill_in('user_first_name', with: 'first_name')
97
90
 
98
- click_on(button_options)
91
+ click_on(class: 'mu-edit-profile-btn', match: :first)
99
92
  expect(page).to have_text('Your data was updated successfully')
100
93
  expect(page).to have_text('My profile')
101
94
  end
@@ -116,5 +116,20 @@ describe WithStudentPathNavigation, organization_workspace: :test do
116
116
 
117
117
  it { expect(next_button(lesson_1)).to include "<a class=\"btn btn-complementary w-100\" role=\"button\" href=\"/chapters/#{chapter_2.friendly_name}\"><span class=\"fa5-text-r\">Next: #{chapter_2.name}</span><i class=\"fas fa-chevron-right\"></i></a>" }
118
118
  end
119
+
120
+ context "when finishing an exam" do
121
+ let!(:organization) { create :organization, exams: [exam] }
122
+
123
+ let(:exam) { create(:exam, exercises: [ exercise ]) }
124
+ let(:exercise) { create(:exercise) }
125
+
126
+ before do
127
+ organization.switch!
128
+ exercise.submit_solution!(current_user).passed!
129
+ end
130
+
131
+ it { expect { next_button(exercise) }.to_not raise_error }
132
+ it { expect(next_button(exercise)).to be_nil }
133
+ end
119
134
  end
120
135
  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.1.0
4
+ version: 9.3.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-04-30 00:00:00.000000000 Z
11
+ date: 2021-05-07 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.1.1
33
+ version: 9.2.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.1.1
40
+ version: 9.2.0
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: mumukit-bridge
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -598,7 +598,9 @@ files:
598
598
  - app/views/errors/internal_server_error.html.erb
599
599
  - app/views/errors/not_found.html.erb
600
600
  - app/views/errors/unauthorized.html.erb
601
- - app/views/exam_authorization_requests/show.html.erb
601
+ - app/views/exam_authorization_requests/_approved.html.erb
602
+ - app/views/exam_authorization_requests/_pending.html.erb
603
+ - app/views/exam_authorization_requests/_rejected.html.erb
602
604
  - app/views/exam_registrations/show.html.erb
603
605
  - app/views/exams/show.html.erb
604
606
  - app/views/exercise_solutions/_assistant_rules_box.html.erb
@@ -714,6 +716,7 @@ files:
714
716
  - app/views/users/certificates.html.erb
715
717
  - app/views/users/discussions.html.erb
716
718
  - app/views/users/edit.html.erb
719
+ - app/views/users/exam_authorizations.html.erb
717
720
  - app/views/users/messages.html.erb
718
721
  - app/views/users/show.html.erb
719
722
  - app/views/users/terms.html.erb
@@ -956,134 +959,134 @@ signing_key:
956
959
  specification_version: 4
957
960
  summary: Code assement web application for the Mumuki Platform.
958
961
  test_files:
959
- - spec/helpers/exercise_input_helper_spec.rb
960
- - spec/helpers/icons_helper_spec.rb
961
- - spec/helpers/breadcrumbs_helper_spec.rb
962
+ - spec/mailers/user_mailer_spec.rb
963
+ - spec/mailers/previews/user_mailer_preview.rb
964
+ - spec/spec_helper.rb
962
965
  - spec/helpers/email_helper_spec.rb
963
- - spec/helpers/avatar_helper_spec.rb
964
- - spec/helpers/application_helper_spec.rb
965
- - spec/helpers/authors_helper_spec.rb
966
- - spec/helpers/certificate_helper_spec.rb
967
966
  - spec/helpers/page_title_helper_spec.rb
968
- - spec/helpers/with_navigation_spec.rb
967
+ - spec/helpers/application_helper_spec.rb
968
+ - spec/helpers/test_results_rendering_spec.rb
969
969
  - spec/helpers/with_choices_spec.rb
970
+ - spec/helpers/exercise_input_helper_spec.rb
971
+ - spec/helpers/avatar_helper_spec.rb
972
+ - spec/helpers/with_navigation_spec.rb
973
+ - spec/helpers/certificate_helper_spec.rb
974
+ - spec/helpers/icons_helper_spec.rb
975
+ - spec/helpers/authors_helper_spec.rb
976
+ - spec/helpers/breadcrumbs_helper_spec.rb
970
977
  - spec/helpers/user_activity_helper_spec.rb
971
- - spec/helpers/test_results_rendering_spec.rb
972
- - spec/spec_helper.rb
973
- - spec/login_helper.rb
974
- - spec/dummy/config/environments/development.rb
975
- - spec/dummy/config/environments/test.rb
976
- - spec/dummy/config/application.rb
977
- - spec/dummy/config/secrets.yml
978
- - spec/dummy/config/initializers/assets.rb
979
- - spec/dummy/config/initializers/wrap_parameters.rb
980
- - spec/dummy/config/initializers/cookies_serializer.rb
981
- - spec/dummy/config/initializers/filter_parameter_logging.rb
982
- - spec/dummy/config/spring.rb
983
- - spec/dummy/config/boot.rb
984
- - spec/dummy/config/database.yml
985
- - spec/dummy/config/cable.yml
986
- - spec/dummy/config/environment.rb
987
- - spec/dummy/config/routes.rb
988
- - spec/dummy/config/rabbit.yml
989
- - spec/dummy/config/locales/en.yml
990
- - spec/dummy/config/puma.rb
991
- - spec/dummy/public/medal/outline.svg
992
- - spec/dummy/public/error/410.svg
993
- - spec/dummy/public/error/timeout_1.svg
994
- - spec/dummy/public/error/timeout_2.svg
995
- - spec/dummy/public/error/timeout_3.svg
996
- - spec/dummy/public/error/403.svg
997
- - spec/dummy/public/error/401.svg
998
- - spec/dummy/public/error/404.svg
999
- - spec/dummy/public/error/500.svg
1000
- - spec/dummy/public/character/magnifying_glass/apparition.svg
1001
- - spec/dummy/public/character/magnifying_glass/loop.svg
1002
- - spec/dummy/public/character/kibi/failure.svg
1003
- - spec/dummy/public/character/kibi/success2_l.svg
1004
- - spec/dummy/public/character/kibi/jump.svg
1005
- - spec/dummy/public/character/kibi/success_l.svg
1006
- - spec/dummy/public/character/kibi/passed_with_warnings.svg
1007
- - spec/dummy/public/character/kibi/context.svg
1008
- - spec/dummy/public/character/animations.json
1009
- - spec/dummy/Rakefile
1010
- - spec/dummy/config.ru
1011
- - spec/dummy/package.json
1012
- - spec/dummy/db/seeds.rb
1013
- - spec/dummy/db/schema.rb
1014
- - spec/dummy/bin/bundle
1015
- - spec/dummy/bin/update
1016
- - spec/dummy/bin/yarn
1017
- - spec/dummy/bin/setup
1018
- - spec/dummy/bin/rails
1019
- - spec/dummy/bin/rake
1020
- - spec/evaluation_helper.rb
1021
- - spec/capybara_helper.rb
1022
- - spec/controllers/certificates_controller_spec.rb
1023
- - spec/controllers/exam_authorization_requests_controller_spec.rb
1024
- - spec/controllers/discussions_controller_spec.rb
1025
- - spec/controllers/messages_controller_spec.rb
1026
- - spec/controllers/chapters_controller_spec.rb
1027
- - spec/controllers/courses_api_controller_spec.rb
1028
- - spec/controllers/api_clients_controller.rb
1029
- - spec/controllers/students_api_controller_spec.rb
1030
- - spec/controllers/exercise_solutions_controller_spec.rb
1031
- - spec/controllers/discussions_messages_controller_spec.rb
1032
- - spec/controllers/users_controller_spec.rb
1033
- - spec/controllers/guide_progress_controller_spec.rb
1034
- - spec/controllers/confirmations_controller_spec.rb
1035
- - spec/controllers/users_api_controller_spec.rb
1036
- - spec/controllers/organizations_api_controller_spec.rb
1037
- - spec/controllers/exam_registrations_controller_spec.rb
1038
- - spec/controllers/invitations_controller_spec.rb
1039
- - spec/teaspoon_env.rb
1040
- - spec/api_helper.rb
1041
- - spec/mailers/user_mailer_spec.rb
1042
- - spec/mailers/previews/user_mailer_preview.rb
1043
- - spec/features/discussion_flow_spec.rb
978
+ - spec/features/guide_reset_spec.rb
1044
979
  - spec/features/runner_assets_spec.rb
1045
- - spec/features/user_activity_flow_spec.rb
1046
- - spec/features/progressive_tips_spec.rb
1047
- - spec/features/immersive_redirection_spec.rb
1048
- - spec/features/menu_bar_spec.rb
1049
- - spec/features/login_flow_spec.rb
1050
- - spec/features/not_found_public_flow_spec.rb
1051
- - spec/features/profile_flow_spec.rb
980
+ - spec/features/disable_user_flow_spec.rb
981
+ - spec/features/topic_flow_spec.rb
982
+ - spec/features/complements_flow_spec.rb
1052
983
  - spec/features/certificate_programs_flow_spec.rb
1053
- - spec/features/lessons_flow_spec.rb
984
+ - spec/features/not_found_private_flow_spec.rb
985
+ - spec/features/user_activity_flow_spec.rb
1054
986
  - spec/features/standard_flow_spec.rb
1055
- - spec/features/guide_reset_spec.rb
1056
- - spec/features/guides_flow_spec.rb
1057
- - spec/features/disable_user_flow_spec.rb
1058
987
  - spec/features/notifications_flow_spec.rb
988
+ - spec/features/exercise_flow_spec.rb
989
+ - spec/features/chapters_flow_spec.rb
990
+ - spec/features/links_flow_spec.rb
1059
991
  - spec/features/terms_flow_spec.rb
1060
- - spec/features/topic_flow_spec.rb
1061
992
  - spec/features/home_public_flow_spec.rb
1062
- - spec/features/exams_flow_spec.rb
993
+ - spec/features/progressive_tips_spec.rb
1063
994
  - spec/features/home_private_flow_spec.rb
1064
- - spec/features/invitations_flow_spec.rb
1065
- - spec/features/links_flow_spec.rb
995
+ - spec/features/discussion_flow_spec.rb
1066
996
  - spec/features/dynamic_exam_spec.rb
1067
- - spec/features/not_found_private_flow_spec.rb
1068
- - spec/features/complements_flow_spec.rb
997
+ - spec/features/invitations_flow_spec.rb
998
+ - spec/features/menu_bar_spec.rb
1069
999
  - spec/features/disabled_organization_flow_spec.rb
1070
- - spec/features/exercise_flow_spec.rb
1071
- - spec/features/chapters_flow_spec.rb
1072
- - spec/javascripts/spec-helper.js
1000
+ - spec/features/lessons_flow_spec.rb
1001
+ - spec/features/login_flow_spec.rb
1002
+ - spec/features/guides_flow_spec.rb
1003
+ - spec/features/exams_flow_spec.rb
1004
+ - spec/features/profile_flow_spec.rb
1005
+ - spec/features/immersive_redirection_spec.rb
1006
+ - spec/features/not_found_public_flow_spec.rb
1007
+ - spec/login_helper.rb
1008
+ - spec/teaspoon_env.rb
1009
+ - spec/evaluation_helper.rb
1010
+ - spec/api_helper.rb
1011
+ - spec/capybara_helper.rb
1012
+ - spec/controllers/exercise_solutions_controller_spec.rb
1013
+ - spec/controllers/users_controller_spec.rb
1014
+ - spec/controllers/discussions_messages_controller_spec.rb
1015
+ - spec/controllers/organizations_api_controller_spec.rb
1016
+ - spec/controllers/courses_api_controller_spec.rb
1017
+ - spec/controllers/exam_authorization_requests_controller_spec.rb
1018
+ - spec/controllers/users_api_controller_spec.rb
1019
+ - spec/controllers/api_clients_controller.rb
1020
+ - spec/controllers/certificates_controller_spec.rb
1021
+ - spec/controllers/invitations_controller_spec.rb
1022
+ - spec/controllers/confirmations_controller_spec.rb
1023
+ - spec/controllers/guide_progress_controller_spec.rb
1024
+ - spec/controllers/messages_controller_spec.rb
1025
+ - spec/controllers/discussions_controller_spec.rb
1026
+ - spec/controllers/chapters_controller_spec.rb
1027
+ - spec/controllers/students_api_controller_spec.rb
1028
+ - spec/controllers/exam_registrations_controller_spec.rb
1029
+ - spec/dummy/bin/yarn
1030
+ - spec/dummy/bin/update
1031
+ - spec/dummy/bin/bundle
1032
+ - spec/dummy/bin/setup
1033
+ - spec/dummy/bin/rake
1034
+ - spec/dummy/bin/rails
1035
+ - spec/dummy/config.ru
1036
+ - spec/dummy/package.json
1037
+ - spec/dummy/public/character/animations.json
1038
+ - spec/dummy/public/character/kibi/jump.svg
1039
+ - spec/dummy/public/character/kibi/success_l.svg
1040
+ - spec/dummy/public/character/kibi/failure.svg
1041
+ - spec/dummy/public/character/kibi/passed_with_warnings.svg
1042
+ - spec/dummy/public/character/kibi/context.svg
1043
+ - spec/dummy/public/character/kibi/success2_l.svg
1044
+ - spec/dummy/public/character/magnifying_glass/apparition.svg
1045
+ - spec/dummy/public/character/magnifying_glass/loop.svg
1046
+ - spec/dummy/public/medal/outline.svg
1047
+ - spec/dummy/public/error/timeout_2.svg
1048
+ - spec/dummy/public/error/401.svg
1049
+ - spec/dummy/public/error/404.svg
1050
+ - spec/dummy/public/error/410.svg
1051
+ - spec/dummy/public/error/timeout_1.svg
1052
+ - spec/dummy/public/error/timeout_3.svg
1053
+ - spec/dummy/public/error/403.svg
1054
+ - spec/dummy/public/error/500.svg
1055
+ - spec/dummy/db/schema.rb
1056
+ - spec/dummy/db/seeds.rb
1057
+ - spec/dummy/Rakefile
1058
+ - spec/dummy/config/initializers/filter_parameter_logging.rb
1059
+ - spec/dummy/config/initializers/wrap_parameters.rb
1060
+ - spec/dummy/config/initializers/assets.rb
1061
+ - spec/dummy/config/initializers/cookies_serializer.rb
1062
+ - spec/dummy/config/secrets.yml
1063
+ - spec/dummy/config/database.yml
1064
+ - spec/dummy/config/boot.rb
1065
+ - spec/dummy/config/locales/en.yml
1066
+ - spec/dummy/config/environment.rb
1067
+ - spec/dummy/config/application.rb
1068
+ - spec/dummy/config/spring.rb
1069
+ - spec/dummy/config/environments/development.rb
1070
+ - spec/dummy/config/environments/test.rb
1071
+ - spec/dummy/config/routes.rb
1072
+ - spec/dummy/config/puma.rb
1073
+ - spec/dummy/config/cable.yml
1074
+ - spec/dummy/config/rabbit.yml
1075
+ - spec/javascripts/bridge-spec.js
1073
1076
  - spec/javascripts/global-spec.js
1074
- - spec/javascripts/kids-button-spec.js
1075
1077
  - spec/javascripts/gamification-spec.js
1076
- - spec/javascripts/i18n-spec.js
1077
- - spec/javascripts/sync-mode-spec.js
1078
- - spec/javascripts/timeout-spec.js
1078
+ - spec/javascripts/spec-helper.js
1079
+ - spec/javascripts/exercise-spec.js
1079
1080
  - spec/javascripts/submissions-store-spec.js
1080
1081
  - spec/javascripts/upload-spec.js
1081
1082
  - spec/javascripts/results-renderers-spec.js
1082
- - spec/javascripts/exercise-spec.js
1083
- - spec/javascripts/csrf-token-spec.js
1084
- - spec/javascripts/editors-spec.js
1085
- - spec/javascripts/elipsis-spec.js
1086
- - spec/javascripts/speech-bubble-renderer-spec.js
1083
+ - spec/javascripts/kids-button-spec.js
1087
1084
  - spec/javascripts/events-spec.js
1088
- - spec/javascripts/bridge-spec.js
1085
+ - spec/javascripts/speech-bubble-renderer-spec.js
1086
+ - spec/javascripts/editors-spec.js
1087
+ - spec/javascripts/sync-mode-spec.js
1089
1088
  - spec/javascripts/timer-spec.js
1089
+ - spec/javascripts/csrf-token-spec.js
1090
+ - spec/javascripts/i18n-spec.js
1091
+ - spec/javascripts/elipsis-spec.js
1092
+ - spec/javascripts/timeout-spec.js
@@ -1,17 +0,0 @@
1
- <%= content_for :breadcrumbs do %>
2
- <%= breadcrumbs @authorization_request %>
3
- <% end %>
4
-
5
- <div class="row">
6
- <div class="mu-inline-block-left">
7
- <h1>
8
- <%= t :exam_registration_to, description: @authorization_request.exam_registration.description %>
9
- </h1>
10
- </div>
11
- </div>
12
-
13
- <% if @authorization_request.approved? %>
14
- <%= t :exam_authorization_request_approved_html, date: l(@authorization_request.exam.start_time, format: :long) %>
15
- <% else %>
16
- <%= t :exam_authorization_request_rejected %>
17
- <% end %>