mumuki-laboratory 9.16.0 → 9.19.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/javascripts/mumuki_laboratory/application/csrf-token.js +5 -5
- data/app/assets/javascripts/mumuki_laboratory/application/discussions.js +1 -0
- data/app/assets/javascripts/mumuki_laboratory/application/exercise.js +17 -2
- data/app/assets/javascripts/mumuki_laboratory/application/timer.js +2 -5
- data/app/controllers/application_controller.rb +1 -1
- data/app/controllers/exam_authorization_requests_controller.rb +22 -17
- data/app/controllers/exam_registrations_controller.rb +1 -1
- data/app/controllers/exercises_controller.rb +0 -1
- data/app/helpers/exams_helper.rb +33 -0
- data/app/helpers/exercise_input_helper.rb +0 -4
- data/app/helpers/menu_bar_helper.rb +5 -4
- data/app/helpers/notifications_helper.rb +1 -1
- data/app/helpers/time_zone_helper.rb +5 -1
- data/app/views/book/show.html.erb +4 -2
- data/app/views/discussions/_actions.html.erb +1 -0
- data/app/views/discussions/_basic_actions.html.erb +20 -0
- data/app/views/discussions/_message.html.erb +4 -0
- data/app/views/discussions/new.html.erb +7 -1
- data/app/views/discussions/show.html.erb +1 -18
- data/app/views/exam_registrations/show.html.erb +1 -1
- data/app/views/exercises/_read_only.html.erb +54 -60
- data/app/views/exercises/show.html.erb +2 -1
- data/app/views/guides/_guide.html.erb +1 -1
- data/app/views/layouts/_timer.html.erb +1 -1
- data/lib/mumuki/laboratory/controllers/validate_access_mode.rb +5 -0
- data/lib/mumuki/laboratory/locales/en.yml +8 -2
- data/lib/mumuki/laboratory/locales/es-CL.yml +8 -2
- data/lib/mumuki/laboratory/locales/es.yml +8 -2
- data/lib/mumuki/laboratory/locales/pt.yml +8 -2
- data/lib/mumuki/laboratory/version.rb +1 -1
- data/spec/controllers/exam_authorization_requests_controller_spec.rb +16 -2
- data/spec/controllers/exercises_controller_spec.rb +32 -0
- data/spec/dummy/db/schema.rb +2 -1
- data/spec/dummy/db/seeds.rb +16 -8
- data/spec/features/read_only_flow_spec.rb +14 -16
- metadata +107 -102
@@ -11,6 +11,7 @@ es-CL:
|
|
11
11
|
and: y
|
12
12
|
appendix: Apéndice
|
13
13
|
appendix_teaser: ¿Quieres saber más? <a href="%{link}">Consulta el apéndice de este capítulo</a>
|
14
|
+
approved_by: Validado por %{validator} el %{date}
|
14
15
|
approved_message: Validado por mentorías
|
15
16
|
approved_messages:
|
16
17
|
one: validado
|
@@ -29,6 +30,7 @@ es-CL:
|
|
29
30
|
authoring: Autores
|
30
31
|
authoring_note_html: Esta guía fue desarrollada por %{authors} bajo los términos de la <a href="https://creativecommons.org/licenses/by-sa/4.0/" target="_blank">Licencia Creative Commons Compartir-Igual, 4.0</a>.
|
31
32
|
authoring_note_with_collaborators_html: Esta guía fue desarrollada por %{authors} y <a href="%{collaborators}" target="_blank">muchas personas más</a>, bajo los términos de la <a href="https://creativecommons.org/licenses/by-sa/4.0/" target="_blank">Licencia Creative Commons Compartir-Igual, 4.0</a>.
|
33
|
+
available_time: Tiempo disponible
|
32
34
|
back_to_mumuki: ¡Vuelve a Mumuki!
|
33
35
|
bibliotheca_ui: Biblioteca
|
34
36
|
birthdate: Fecha de nacimiento
|
@@ -65,11 +67,13 @@ es-CL:
|
|
65
67
|
continue_lesson: ¡Continúa esta lección!
|
66
68
|
continue_practicing: ¡Sigue aprendiendo!
|
67
69
|
correct_answer: ¡La respuesta es correcta!
|
70
|
+
course: Curso
|
68
71
|
create_submission: Enviar
|
69
72
|
created_at: Creado
|
70
73
|
created_exercises: Ejercicios Creados
|
71
74
|
created_guides: Lecciones Creadas
|
72
75
|
date: Fecha
|
76
|
+
date_and_time: Fecha y hora
|
73
77
|
deleted_by: Eliminado por %{deleter}
|
74
78
|
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.
|
75
79
|
deletion_motive:
|
@@ -120,9 +124,9 @@ es-CL:
|
|
120
124
|
exam_authorization_pending_change_date_html: Tienes tiempo hasta el <strong>%{end_time}</strong> (hora de %{location}) para cambiar el turno haciendo click <strong><a href="%{edit_path}">aquí</a></strong>. Pasada esa fecha, tu solicitud será evaluada y recibirás una confirmación. <br> ¡No olvides revisar las notificaciones!
|
121
125
|
exam_authorization_pending_done_html: Ya te inscribiste a este examen. Luego del <strong>%{end_time}</strong> (hora de %{location}) se evaluará tu solicitud y recibirás una confirmación. <br> ¡No olvides de revisar las notificaciones!
|
122
126
|
exam_authorization_request_approved_html: Tu solicitud fue aprobada, no olvides conectarte el <strong>%{date}</strong> (hora de %{location}). ¡Buena suerte!
|
123
|
-
exam_authorization_request_created:
|
127
|
+
exam_authorization_request_created: Te has inscripto al examen del día %{friendly_date}
|
124
128
|
exam_authorization_request_rejected: Tu solicitud fue rechazada porque no cumpliste con los requisitos para rendir el examen.
|
125
|
-
exam_authorization_request_saved:
|
129
|
+
exam_authorization_request_saved: Has cambiado tu inscripción al examen al día %{friendly_date}
|
126
130
|
exam_authorization_request_updated: Hay novedades sobre tu inscripción a %{description}
|
127
131
|
exam_registration_choose_exam: Seleccioná día y horario en el que te gustaría rendir el examen
|
128
132
|
exam_registration_explanation_html: Tienes tiempo hasta el <strong>%{date}</strong> (hora de %{location}) para inscribirte. Pasada esa fecha, tu solicitud será evaluada y recibirás una confirmación. <br> ¡No olvides revisar las notificaciones!
|
@@ -280,6 +284,7 @@ es-CL:
|
|
280
284
|
notifications_will_be_here: Tus notificaciones aparecerán aquí
|
281
285
|
notify_problem_with_exercise: Reporta un bug
|
282
286
|
office: Secretaría
|
287
|
+
only_forum_questions_on_forum: Recuerda que en el espacio de consultas se responden únicamente dudas relacionadas a los ejercicios. Para cualquier otro tipo de consulta, revisa la %{link}.
|
283
288
|
only_landscape_support: Por favor, rota tu tablet o celular para realizar ejercicios
|
284
289
|
opened: Abierta
|
285
290
|
opened_count:
|
@@ -374,6 +379,7 @@ es-CL:
|
|
374
379
|
terms_and_conditions_continue_disclaimer: Al continuar aceptas los %{terms_link}
|
375
380
|
terms_and_conditions_must_be_accepted: Tienes que aceptar los términos y condiciones
|
376
381
|
test_results: Resultados de las pruebas
|
382
|
+
time_in_minutes: "%{time} minutos"
|
377
383
|
time_since: "hace %{time}"
|
378
384
|
time_left: Te quedan
|
379
385
|
title: Título
|
@@ -14,6 +14,7 @@ es:
|
|
14
14
|
and: y
|
15
15
|
appendix: Apéndice
|
16
16
|
appendix_teaser: ¿Querés saber más? <a href="%{link}">Consultá el apéndice de este capítulo</a>
|
17
|
+
approved_by: Validado por %{validator} el %{date}
|
17
18
|
approved_message: Validado por mentorías
|
18
19
|
approved_messages:
|
19
20
|
one: validado
|
@@ -32,6 +33,7 @@ es:
|
|
32
33
|
authoring: Autores
|
33
34
|
authoring_note_html: Esta guía fue desarrollada por %{authors} bajo los términos de la <a href="https://creativecommons.org/licenses/by-sa/4.0/" target="_blank">Licencia Creative Commons Compartir-Igual, 4.0</a>.
|
34
35
|
authoring_note_with_collaborators_html: Esta guía fue desarrollada por %{authors} y <a href="%{collaborators}" target="_blank">muchas personas más</a>, bajo los términos de la <a href="https://creativecommons.org/licenses/by-sa/4.0/" target="_blank">Licencia Creative Commons Compartir-Igual, 4.0</a>.
|
36
|
+
available_time: Tiempo disponible
|
35
37
|
back_to_mumuki: ¡Volvé a Mumuki!
|
36
38
|
bibliotheca_ui: Biblioteca
|
37
39
|
birthdate: Fecha de nacimiento
|
@@ -68,6 +70,7 @@ es:
|
|
68
70
|
continue_lesson: ¡Continuá esta lección!
|
69
71
|
continue_practicing: ¡Seguí aprendiendo!
|
70
72
|
correct_answer: ¡La respuesta es correcta!
|
73
|
+
course: Curso
|
71
74
|
create_submission: Enviar
|
72
75
|
created_at: Creado
|
73
76
|
created_at_asc: Antiguas
|
@@ -75,6 +78,7 @@ es:
|
|
75
78
|
created_exercises: Ejercicios Creados
|
76
79
|
created_guides: Lecciones Creadas
|
77
80
|
date: Fecha
|
81
|
+
date_and_time: Fecha y hora
|
78
82
|
deleted_by: Eliminado por %{deleter}
|
79
83
|
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.
|
80
84
|
deletion_motive:
|
@@ -127,9 +131,9 @@ es:
|
|
127
131
|
exam_authorization_pending_change_date_html: Tenés tiempo hasta el <strong>%{end_time}</strong> (hora de %{location}) 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!
|
128
132
|
exam_authorization_pending_done_html: Ya te inscribiste a este examen. Luego del <strong>%{end_time}</strong> (hora de %{location}) se evaluará tu solicitud y recibirás una confirmación. <br> ¡No te olvides de revisar las notificaciones!
|
129
133
|
exam_authorization_request_approved_html: Tu solicitud fue aprobada, no olvides conectarte el <strong>%{date}</strong> (hora de %{location}). ¡Buena suerte!
|
130
|
-
exam_authorization_request_created:
|
134
|
+
exam_authorization_request_created: Te inscribiste al examen del día %{friendly_date}
|
131
135
|
exam_authorization_request_rejected: Tu solicitud fue rechazada porque no cumpliste con los requisitos para rendir el examen.
|
132
|
-
exam_authorization_request_saved:
|
136
|
+
exam_authorization_request_saved: Cambiaste tu inscripción al examen al día %{friendly_date}
|
133
137
|
exam_authorization_request_updated: Hay novedades sobre tu inscripción a %{description}
|
134
138
|
exam_registration_choose_exam: Seleccioná día y horario en el que te gustaría rendir el examen
|
135
139
|
exam_registration_explanation_html: Tenés tiempo hasta el <strong>%{date}</strong> (hora de %{location}) para inscribirte. Pasada esa fecha, tu solicitud será evaluada y recibirás una confirmación. <br> ¡No te olvides de revisar las notificaciones!
|
@@ -289,6 +293,7 @@ es:
|
|
289
293
|
notifications_will_be_here: Tus notificaciones aparecerán aquí
|
290
294
|
notify_problem_with_exercise: Reportá un bug
|
291
295
|
office: Secretaría
|
296
|
+
only_forum_questions_on_forum: Recordá que en el espacio de consultas se responden únicamente dudas relacionadas a los ejercicios. Para cualquier otro tipo de consulta, revisá la %{link}.
|
292
297
|
only_landscape_support: Por favor, rotá tu tablet o celular para realizar ejercicios
|
293
298
|
opened: Abierta
|
294
299
|
opened_count:
|
@@ -388,6 +393,7 @@ es:
|
|
388
393
|
terms_and_conditions_continue_disclaimer: Al continuar estás aceptando los %{terms_link}
|
389
394
|
terms_and_conditions_must_be_accepted: Tenés que aceptar los términos y condiciones
|
390
395
|
test_results: Resultados de las pruebas
|
396
|
+
time_in_minutes: "%{time} minutos"
|
391
397
|
time_since: "hace %{time}"
|
392
398
|
time_left: Te quedan
|
393
399
|
title: Título
|
@@ -13,6 +13,7 @@ pt:
|
|
13
13
|
and: e
|
14
14
|
appendix: Apêndice
|
15
15
|
appendix_teaser: Você quer saber mais? <a href="%{link}"> Consulte o apêndice deste capítulo </a>
|
16
|
+
approved_by: Validado pelo %{validator} em %{date}
|
16
17
|
approved_message: Validado pelo mentor
|
17
18
|
approved_messages:
|
18
19
|
one: validado
|
@@ -31,6 +32,7 @@ pt:
|
|
31
32
|
authoring: Autores
|
32
33
|
authoring_note_html: 'Este guia foi desenvolvido por %{authors} nos termos do <a href = "https://creativecommons.org/licenses/by-sa/4.0/" target="_blank"> Creative Commons License Share-Equal, 4.0 </a>.'
|
33
34
|
authoring_note_with_collaborators_html: 'Este guia foi desenvolvido por %{authors} e <a href="%{collaborators}" target="_blank">muitas outras pessoas </a>, nos termos do <a href = "https://creativecommons.org/licenses/by-sa/4.0/" target="_blank"> Creative Commons License Share-Equal, 4.0 </a>.'
|
35
|
+
available_time: Tempo disponível
|
34
36
|
back_to_mumuki: Voltei para Mumuki!
|
35
37
|
bibliotheca_ui: Biblioteca
|
36
38
|
birthdate: Fecha de nacimiento
|
@@ -64,6 +66,7 @@ pt:
|
|
64
66
|
continue_lesson: Continue esta lição!
|
65
67
|
continue_practicing: Continue aprendendo!
|
66
68
|
correct_answer: A resposta está correta!
|
69
|
+
course: Curso
|
67
70
|
create_submission: Enviar
|
68
71
|
created_at: Criado
|
69
72
|
created_at_asc: Antigo
|
@@ -71,6 +74,7 @@ pt:
|
|
71
74
|
created_exercises: Exercícios criados
|
72
75
|
created_guides: Lições criadas
|
73
76
|
date: Data
|
77
|
+
date_and_time: Data e hora
|
74
78
|
deleted_by: Removido pelo
|
75
79
|
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.
|
76
80
|
deletion_motive:
|
@@ -120,9 +124,9 @@ pt:
|
|
120
124
|
errored: Opa! Sua solução não pode ser executada
|
121
125
|
exam_authorization_pending_explanation_html: Você tem tempo até <strong>%{date}</strong> (horário de %{location}) 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!
|
122
126
|
exam_authorization_request_approved_html: Sua solicitação foi aprovada, não se esqueça de conectar em <strong>%{date}</strong> (horário de %{location}). Boa sorte!
|
123
|
-
exam_authorization_request_created:
|
127
|
+
exam_authorization_request_created: Você se inscreveu para o exame do dia %{friendly_date}
|
124
128
|
exam_authorization_request_rejected: Sua solicitação foi rejeitada porque você não atendeu aos requisitos.
|
125
|
-
exam_authorization_request_saved:
|
129
|
+
exam_authorization_request_saved: Você alterou seu registro de exame para o dia %{friendly_date}
|
126
130
|
exam_authorization_request_updated: Há notícias sobre seu registro para %{description}
|
127
131
|
exam_registration_choose_exam: Selecione o dia e a hora em que gostaria de fazer o exame
|
128
132
|
exam_registration_explanation_html: Você tem tempo até <strong>%{date}</strong> (horário de %{location}) 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!
|
@@ -280,6 +284,7 @@ pt:
|
|
280
284
|
notifications_will_be_here: Suas notificações aparecerão aqui
|
281
285
|
notify_problem_with_exercise: Relatar um erro
|
282
286
|
office: Secretariado
|
287
|
+
only_forum_questions_on_forum: Lembre-se que apenas as dúvidas relacionadas aos exercícios são respondidas no espaço de consulta. Para qualquer outro tipo de consulta, reveja a %{link}.
|
283
288
|
only_landscape_support: Por favor, gire seu tablet ou celular para realizar exercícios
|
284
289
|
opened: Aberto
|
285
290
|
opened_count: '%{count} aberto'
|
@@ -373,6 +378,7 @@ pt:
|
|
373
378
|
terms_and_conditions_continue_disclaimer: Ao continuar, você concorda %{terms_link}
|
374
379
|
terms_and_conditions_must_be_accepted: Você deve aceitar os Termos e Condições
|
375
380
|
test_results: Resultados do teste
|
381
|
+
time_in_minutes: "%{time} minutos"
|
376
382
|
time_since: "há %{time}"
|
377
383
|
time_left: Te deixam
|
378
384
|
title: Título
|
@@ -3,7 +3,9 @@ require 'spec_helper'
|
|
3
3
|
describe ExamAuthorizationRequestsController, type: :controller, organization_workspace: :test do
|
4
4
|
let(:user) { create(:user) }
|
5
5
|
let(:exam) { create(:exam) }
|
6
|
-
let(:
|
6
|
+
let(:exam_id) { exam.id }
|
7
|
+
let(:organization) { Organization.current }
|
8
|
+
let(:exam_registration) { create(:exam_registration, exams: [exam], organization: organization) }
|
7
9
|
|
8
10
|
before { set_current_user! user }
|
9
11
|
|
@@ -12,12 +14,24 @@ describe ExamAuthorizationRequestsController, type: :controller, organization_wo
|
|
12
14
|
|
13
15
|
def do_post
|
14
16
|
post :create, params: {
|
15
|
-
exam_authorization_request: { exam_id:
|
17
|
+
exam_authorization_request: { exam_id: exam_id, exam_registration_id: exam_registration.id }
|
16
18
|
}
|
17
19
|
end
|
18
20
|
|
19
21
|
before { do_post }
|
20
22
|
|
23
|
+
describe 'called once in wrong organization' do
|
24
|
+
let(:organization) { create(:organization, name: 'other') }
|
25
|
+
it { expect(response.status).to eq 404 }
|
26
|
+
it { expect(exam_registration.authorization_requests.size).to be 0 }
|
27
|
+
end
|
28
|
+
|
29
|
+
describe 'called once with wrong exam' do
|
30
|
+
let(:exam_id) { create(:exam).id }
|
31
|
+
it { expect(response.status).to eq 404 }
|
32
|
+
it { expect(exam_registration.authorization_requests.size).to be 0 }
|
33
|
+
end
|
34
|
+
|
21
35
|
describe 'called once' do
|
22
36
|
it { expect(response.status).to eq 302 }
|
23
37
|
it { expect(exam_registration.authorization_requests.size).to be 1 }
|
@@ -0,0 +1,32 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe ExercisesController, organization_workspace: :test do
|
4
|
+
let(:user) { create(:user) }
|
5
|
+
|
6
|
+
let(:problem) { create(:problem) }
|
7
|
+
let!(:exam) { create :exam, exercises: [problem], duration: 10, start_time: 1.hour.ago, end_time: 1.hour.since }
|
8
|
+
|
9
|
+
before { reindex_current_organization! }
|
10
|
+
before { set_current_user! user }
|
11
|
+
|
12
|
+
|
13
|
+
describe 'show' do
|
14
|
+
context 'when user is in the middle of an exam' do
|
15
|
+
|
16
|
+
let!(:exam_authorization) { create :exam_authorization, exam: exam, user: user, started: true, started_at: started_at }
|
17
|
+
before { get :show, params: { id: problem.id } }
|
18
|
+
|
19
|
+
context 'when user is not out of time yet' do
|
20
|
+
let(:started_at) { 5.minutes.ago }
|
21
|
+
|
22
|
+
it { expect(response.status).to eq 200 }
|
23
|
+
end
|
24
|
+
|
25
|
+
context 'when user is out of time' do
|
26
|
+
let(:started_at) { 20.minutes.ago }
|
27
|
+
|
28
|
+
it { expect(response.status).to eq 410 }
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
data/spec/dummy/db/schema.rb
CHANGED
@@ -10,7 +10,7 @@
|
|
10
10
|
#
|
11
11
|
# It's strongly recommended that you check this file into your version control system.
|
12
12
|
|
13
|
-
ActiveRecord::Schema.define(version:
|
13
|
+
ActiveRecord::Schema.define(version: 20210929223144) do
|
14
14
|
|
15
15
|
# These are extensions that must be enabled in order to support this database
|
16
16
|
enable_extension "plpgsql"
|
@@ -194,6 +194,7 @@ ActiveRecord::Schema.define(version: 20210803175124) do
|
|
194
194
|
t.datetime "created_at", null: false
|
195
195
|
t.datetime "updated_at", null: false
|
196
196
|
t.boolean "processed", default: false
|
197
|
+
t.integer "authorization_requests_limit"
|
197
198
|
t.index ["organization_id"], name: "index_exam_registrations_on_organization_id"
|
198
199
|
end
|
199
200
|
|
data/spec/dummy/db/seeds.rb
CHANGED
@@ -9,22 +9,30 @@ Organization.find_or_create_by!(name: 'base') do |org|
|
|
9
9
|
org.public = true
|
10
10
|
org.login_methods = Mumukit::Login::Settings.login_methods
|
11
11
|
org.locale = 'es'
|
12
|
+
org.time_zone = 'Buenos Aires'
|
12
13
|
end
|
13
14
|
|
14
15
|
Organization.find_or_create_by!(name: 'private') do |org|
|
15
|
-
org.book = Book.find_by!(slug: '
|
16
|
+
org.book = Book.find_by!(slug: 'mumuki/mumuki-libro-programacion')
|
16
17
|
org.public = false
|
18
|
+
org.time_zone = 'Buenos Aires'
|
17
19
|
end
|
18
20
|
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
21
|
+
Organization.find_or_create_by!(name: 'primaria') do |org|
|
22
|
+
org.book = Book.find_by!(slug: 'mumukiproject/mumuki-libro-primaria')
|
23
|
+
org.login_methods = Mumukit::Login::Settings.login_methods
|
24
|
+
org.public = true
|
25
|
+
org.time_zone = 'Buenos Aires'
|
26
|
+
end
|
24
27
|
|
25
|
-
Organization.find_or_create_by!(name: 'central')
|
28
|
+
Organization.find_or_create_by!(name: 'central') do |org|
|
29
|
+
org.book = Book.find_by!(slug: 'mumuki/mumuki-libro-programacion')
|
30
|
+
org.login_methods = Mumukit::Login::Settings.login_methods
|
31
|
+
org.public = true
|
32
|
+
org.time_zone = 'Buenos Aires'
|
33
|
+
end
|
26
34
|
|
27
|
-
User.find_or_create_by!(uid: 'dev.student@mumuki.org') { |org| org.permissions = {student: '
|
35
|
+
User.find_or_create_by!(uid: 'dev.student@mumuki.org') { |org| org.permissions = {student: 'private/*'} }
|
28
36
|
User.find_or_create_by!(uid: 'dev.teacher@mumuki.org') { |org| org.permissions = {teacher: 'private/*'} }
|
29
37
|
User.find_or_create_by!(uid: 'dev.admin@mumuki.org') { |org| org.permissions = {admin: '*/*'} }
|
30
38
|
User.find_or_create_by!(uid: 'dev.owner@mumuki.org') { |org| org.permissions = {owner: '*/*'} }
|
@@ -470,20 +470,22 @@ feature 'Read Only Flow' do
|
|
470
470
|
|
471
471
|
context 'and user is ex student of organization' do
|
472
472
|
before { user.update! permissions: { ex_student: slug } }
|
473
|
-
scenario 'avatar
|
473
|
+
scenario 'avatar dropdown' do
|
474
474
|
visit "/"
|
475
475
|
find('#profileDropdown').click
|
476
|
-
expect(page).
|
477
|
-
expect(page).
|
478
|
-
expect(page).not_to have_text('Classroom')
|
479
|
-
expect(page).not_to have_text('Solve other\'s doubts')
|
476
|
+
expect(page).to have_text('My account')
|
477
|
+
expect(page).to have_text('FAQs')
|
480
478
|
expect(page).not_to have_text('My doubts')
|
479
|
+
expect(page).not_to have_text('Classroom')
|
481
480
|
expect(page).not_to have_text('Bibliotheca')
|
481
|
+
expect(page).not_to have_text('Solve other\'s doubts')
|
482
482
|
expect(page).to have_text('Sign Out')
|
483
483
|
end
|
484
484
|
scenario 'show book' do
|
485
485
|
visit "/"
|
486
|
-
expect(page).
|
486
|
+
expect(page).not_to have_text('Chapter 1')
|
487
|
+
expect(page).not_to have_text('Chapter 2')
|
488
|
+
expect(page).not_to have_text('Practicing!')
|
487
489
|
end
|
488
490
|
scenario 'show chapter' do
|
489
491
|
visit "/chapters/#{chapter1.id}"
|
@@ -503,27 +505,23 @@ feature 'Read Only Flow' do
|
|
503
505
|
end
|
504
506
|
scenario 'show profile' do
|
505
507
|
visit "/user"
|
506
|
-
expect(page).to have_text('
|
508
|
+
expect(page).to have_text('My profile')
|
507
509
|
end
|
508
510
|
scenario 'show faqs' do
|
509
511
|
visit "/faqs"
|
510
|
-
expect(page).to have_text('
|
511
|
-
end
|
512
|
-
scenario 'show discussion' do
|
513
|
-
visit "/discussions"
|
514
|
-
expect(page).to have_text('You are not allowed to see this content')
|
512
|
+
expect(page).to have_text('FAQs')
|
515
513
|
end
|
516
514
|
scenario 'show discussion in existent exercise' do
|
517
515
|
visit "/exercises/#{exercise111.id}/discussions/#{discussion111.id}"
|
518
|
-
expect(page).to have_text('
|
516
|
+
expect(page).to have_text('Page was not found')
|
519
517
|
end
|
520
518
|
scenario 'show discussion in existent exercise' do
|
521
519
|
visit "/exercises/#{exercise112.id}/discussions/#{discussion112.id}"
|
522
|
-
expect(page).to have_text('
|
520
|
+
expect(page).to have_text('Page was not found')
|
523
521
|
end
|
524
522
|
scenario 'new discussion' do
|
525
523
|
visit "/exercises/#{exercise112.id}/discussions/new"
|
526
|
-
expect(page).to have_text('
|
524
|
+
expect(page).to have_text('Page was not found')
|
527
525
|
end
|
528
526
|
end
|
529
527
|
|
@@ -740,7 +738,7 @@ feature 'Read Only Flow' do
|
|
740
738
|
|
741
739
|
context 'and user is ex student of organization' do
|
742
740
|
before { user.update! permissions: { ex_student: slug } }
|
743
|
-
scenario 'avatar
|
741
|
+
scenario 'avatar dorpdownz' do
|
744
742
|
visit "/"
|
745
743
|
find('#profileDropdown').click
|
746
744
|
expect(page).to have_text('My account')
|