mumuki-laboratory 8.5.0 → 8.6.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/stylesheets/mumuki_laboratory/application/modules/_discussion.scss +31 -8
  3. data/app/controllers/application_controller.rb +1 -1
  4. data/app/controllers/exam_authorization_requests_controller.rb +26 -0
  5. data/app/controllers/exam_registrations_controller.rb +6 -0
  6. data/app/helpers/application_helper.rb +4 -0
  7. data/app/helpers/icons_helper.rb +3 -11
  8. data/app/helpers/menu_bar_helper.rb +2 -2
  9. data/app/helpers/progress_bar_helper.rb +2 -2
  10. data/app/views/chapters/show.html.erb +2 -2
  11. data/app/views/discussions/_message.html.erb +7 -7
  12. data/app/views/exam_authorization_requests/show.html.erb +17 -0
  13. data/app/views/exam_registrations/show.html.erb +37 -0
  14. data/app/views/exercises/show.html.erb +1 -1
  15. data/app/views/layouts/_guide.html.erb +3 -3
  16. data/app/views/layouts/_progress_bar.html.erb +9 -7
  17. data/app/views/layouts/_progress_listing.html.erb +5 -5
  18. data/app/views/layouts/application.html.erb +1 -6
  19. data/app/views/notifications/_discussion.html.erb +1 -0
  20. data/app/views/notifications/_dropdown.html.erb +13 -0
  21. data/app/views/notifications/_exam_authorization_request.html.erb +1 -0
  22. data/app/views/notifications/_exam_registration.html.erb +1 -0
  23. data/app/views/notifications/_message.html.erb +1 -0
  24. data/config/routes.rb +3 -0
  25. data/lib/mumuki/laboratory/controllers/notifications.rb +3 -22
  26. data/lib/mumuki/laboratory/locales/en.yml +28 -14
  27. data/lib/mumuki/laboratory/locales/es-CL.yml +20 -6
  28. data/lib/mumuki/laboratory/locales/es.yml +25 -12
  29. data/lib/mumuki/laboratory/locales/pt.yml +22 -8
  30. data/lib/mumuki/laboratory/version.rb +1 -1
  31. data/spec/controllers/exam_authorization_requests_controller_spec.rb +40 -0
  32. data/spec/controllers/exam_registrations_controller_spec.rb +19 -0
  33. data/spec/features/notifications_flow_spec.rb +46 -0
  34. metadata +113 -98
@@ -1,5 +1,5 @@
1
1
  module Mumuki
2
2
  module Laboratory
3
- VERSION = '8.5.0'
3
+ VERSION = '8.6.0'
4
4
  end
5
5
  end
@@ -0,0 +1,40 @@
1
+ require 'spec_helper'
2
+
3
+ describe ExamAuthorizationRequestsController, type: :controller, organization_workspace: :test do
4
+ let(:user) { create(:user) }
5
+ let(:exam) { create(:exam) }
6
+ let(:exam_registration) { create(:exam_registration, exams: [exam]) }
7
+
8
+ before { set_current_user! user }
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
+ describe 'create' do
28
+ let!(:notification) { create(:notification, target: exam_registration, user: user) }
29
+
30
+ before do
31
+ post :create, params: {
32
+ exam_authorization_request: { exam_id: exam.id, exam_registration_id: exam_registration.id }
33
+ }
34
+ end
35
+
36
+ it { expect(response.status).to eq 204 }
37
+ it { expect(exam_registration.authorization_requests.length).to be 1 }
38
+ it { expect(notification.reload.read).to be_truthy }
39
+ end
40
+ end
@@ -0,0 +1,19 @@
1
+ require 'spec_helper'
2
+
3
+ describe ExamRegistrationsController, type: :controller, organization_workspace: :test do
4
+ describe 'show' do
5
+ context 'when registration does not exist' do
6
+ before { get :show, params: {id: 0} }
7
+
8
+ it { expect(response.status).to eq 404 }
9
+ end
10
+
11
+ context 'when registration exists' do
12
+ let!(:registration) { create(:exam_registration) }
13
+
14
+ before { get :show, params: {id: registration.id} }
15
+
16
+ it { expect(response.status).to eq 200 }
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,46 @@
1
+ require 'spec_helper'
2
+
3
+ feature 'Notifications Flow', organization_workspace: :test do
4
+ let!(:chapter) { create(:chapter) }
5
+ let(:organization) { Organization.current }
6
+ let(:user) { create(:user) }
7
+
8
+ before { reindex_current_organization! }
9
+ before { set_current_user!(user) }
10
+
11
+ def notifications_bell
12
+ find '.badge-notifications'
13
+ end
14
+
15
+ def find_notification_number(number)
16
+ find('#notificationsDropdown').click
17
+ find "#notificationsPanel li:nth-child(#{number}) a"
18
+ end
19
+
20
+ context 'user with notifications' do
21
+ let(:exam_registration) { create(:exam_registration, description: 'Mid term exam 2020') }
22
+ let(:exam_authorization_request) { create(:exam_authorization_request, exam_registration: exam_registration, user: user) }
23
+
24
+ let!(:notifications) do
25
+ [exam_registration, exam_authorization_request].map { |target| create(:notification, user: user, target: target ) }
26
+ end
27
+
28
+ before { visit '/' }
29
+
30
+ scenario 'displays count on navigation bar' do
31
+ expect(notifications_bell).to have_text('2')
32
+ end
33
+
34
+ scenario 'navigates to target on notification click' do
35
+ find_notification_number(2).click
36
+ expect(page).to have_text 'Registration to Mid term exam 2020'
37
+ expect(page).to have_text 'Choose date and time to attend to the exam'
38
+ end
39
+
40
+ scenario 'removes notification after target is processed' do
41
+ # Notification for exam authorization request is considered read after user click
42
+ find_notification_number(1).click
43
+ expect(notifications_bell).to have_text('1')
44
+ end
45
+ end
46
+ 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: 8.5.0
4
+ version: 8.6.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-02-04 00:00:00.000000000 Z
11
+ date: 2021-02-12 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: 8.5.0
33
+ version: 8.6.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: 8.5.0
40
+ version: 8.6.0
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: mumukit-bridge
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -465,6 +465,8 @@ files:
465
465
  - app/controllers/concerns/with_user_params.rb
466
466
  - app/controllers/discussions_controller.rb
467
467
  - app/controllers/discussions_messages_controller.rb
468
+ - app/controllers/exam_authorization_requests_controller.rb
469
+ - app/controllers/exam_registrations_controller.rb
468
470
  - app/controllers/exams_controller.rb
469
471
  - app/controllers/exercise_confirmations_controller.rb
470
472
  - app/controllers/exercise_query_controller.rb
@@ -537,6 +539,8 @@ files:
537
539
  - app/views/errors/internal_server_error.html.erb
538
540
  - app/views/errors/not_found.html.erb
539
541
  - app/views/errors/unauthorized.html.erb
542
+ - app/views/exam_authorization_requests/show.html.erb
543
+ - app/views/exam_registrations/show.html.erb
540
544
  - app/views/exams/show.html.erb
541
545
  - app/views/exercise_solutions/_assistant_rules_box.html.erb
542
546
  - app/views/exercise_solutions/_contextualization_results_body.html.erb
@@ -623,6 +627,11 @@ files:
623
627
  - app/views/layouts/modals/_new_message.html.erb
624
628
  - app/views/lessons/show.html.erb
625
629
  - app/views/messages/errors.html.erb
630
+ - app/views/notifications/_discussion.html.erb
631
+ - app/views/notifications/_dropdown.html.erb
632
+ - app/views/notifications/_exam_authorization_request.html.erb
633
+ - app/views/notifications/_exam_registration.html.erb
634
+ - app/views/notifications/_message.html.erb
626
635
  - app/views/user_mailer/1st_reminder.html.erb
627
636
  - app/views/user_mailer/1st_reminder.text.erb
628
637
  - app/views/user_mailer/2nd_reminder.html.erb
@@ -689,6 +698,8 @@ files:
689
698
  - spec/controllers/courses_api_controller_spec.rb
690
699
  - spec/controllers/discussions_controller_spec.rb
691
700
  - spec/controllers/discussions_messages_controller_spec.rb
701
+ - spec/controllers/exam_authorization_requests_controller_spec.rb
702
+ - spec/controllers/exam_registrations_controller_spec.rb
692
703
  - spec/controllers/exercise_solutions_controller_spec.rb
693
704
  - spec/controllers/guide_progress_controller_spec.rb
694
705
  - spec/controllers/invitations_controller_spec.rb
@@ -764,6 +775,7 @@ files:
764
775
  - spec/features/menu_bar_spec.rb
765
776
  - spec/features/not_found_private_flow_spec.rb
766
777
  - spec/features/not_found_public_flow_spec.rb
778
+ - spec/features/notifications_flow_spec.rb
767
779
  - spec/features/profile_flow_spec.rb
768
780
  - spec/features/progressive_tips_spec.rb
769
781
  - spec/features/runner_assets_spec.rb
@@ -868,125 +880,128 @@ signing_key:
868
880
  specification_version: 4
869
881
  summary: Code assement web application for the Mumuki Platform.
870
882
  test_files:
871
- - spec/mailers/user_mailer_spec.rb
883
+ - spec/controllers/invitations_controller_spec.rb
884
+ - spec/controllers/discussions_controller_spec.rb
885
+ - spec/controllers/api_clients_controller.rb
886
+ - spec/controllers/guide_progress_controller_spec.rb
887
+ - spec/controllers/exercise_solutions_controller_spec.rb
888
+ - spec/controllers/courses_api_controller_spec.rb
889
+ - spec/controllers/exam_registrations_controller_spec.rb
890
+ - spec/controllers/students_api_controller_spec.rb
891
+ - spec/controllers/messages_controller_spec.rb
892
+ - spec/controllers/exam_authorization_requests_controller_spec.rb
893
+ - spec/controllers/confirmations_controller_spec.rb
894
+ - spec/controllers/discussions_messages_controller_spec.rb
895
+ - spec/controllers/users_api_controller_spec.rb
896
+ - spec/controllers/chapters_controller_spec.rb
897
+ - spec/controllers/organizations_api_controller_spec.rb
898
+ - spec/controllers/users_controller_spec.rb
899
+ - spec/evaluation_helper.rb
900
+ - spec/capybara_helper.rb
901
+ - spec/login_helper.rb
872
902
  - spec/mailers/previews/user_mailer_preview.rb
873
- - spec/api_helper.rb
874
- - spec/dummy/config/boot.rb
875
- - spec/dummy/config/secrets.yml
876
- - spec/dummy/config/puma.rb
877
- - spec/dummy/config/initializers/wrap_parameters.rb
878
- - spec/dummy/config/initializers/cookies_serializer.rb
879
- - spec/dummy/config/initializers/filter_parameter_logging.rb
880
- - spec/dummy/config/initializers/assets.rb
881
- - spec/dummy/config/application.rb
882
- - spec/dummy/config/environment.rb
883
- - spec/dummy/config/locales/en.yml
884
- - spec/dummy/config/spring.rb
885
- - spec/dummy/config/rabbit.yml
886
- - spec/dummy/config/environments/test.rb
887
- - spec/dummy/config/environments/development.rb
888
- - spec/dummy/config/cable.yml
889
- - spec/dummy/config/routes.rb
890
- - spec/dummy/config/database.yml
891
- - spec/dummy/db/seeds.rb
892
- - spec/dummy/db/schema.rb
893
- - spec/dummy/Rakefile
894
- - spec/dummy/bin/rake
895
- - spec/dummy/bin/rails
896
- - spec/dummy/bin/yarn
903
+ - spec/mailers/user_mailer_spec.rb
904
+ - spec/spec_helper.rb
905
+ - spec/dummy/package.json
897
906
  - spec/dummy/bin/bundle
898
907
  - spec/dummy/bin/update
899
908
  - spec/dummy/bin/setup
900
- - spec/dummy/public/character/magnifying_glass/apparition.svg
901
- - spec/dummy/public/character/magnifying_glass/loop.svg
902
- - spec/dummy/public/character/kibi/success2_l.svg
909
+ - spec/dummy/bin/rake
910
+ - spec/dummy/bin/rails
911
+ - spec/dummy/bin/yarn
912
+ - spec/dummy/public/character/kibi/jump.svg
903
913
  - spec/dummy/public/character/kibi/context.svg
904
914
  - spec/dummy/public/character/kibi/success_l.svg
905
915
  - spec/dummy/public/character/kibi/failure.svg
906
- - spec/dummy/public/character/kibi/jump.svg
916
+ - spec/dummy/public/character/kibi/success2_l.svg
907
917
  - spec/dummy/public/character/kibi/passed_with_warnings.svg
918
+ - spec/dummy/public/character/magnifying_glass/apparition.svg
919
+ - spec/dummy/public/character/magnifying_glass/loop.svg
908
920
  - spec/dummy/public/character/animations.json
909
921
  - spec/dummy/public/medal/outline.svg
910
- - spec/dummy/public/error/timeout_3.svg
911
- - spec/dummy/public/error/timeout_1.svg
912
922
  - spec/dummy/public/error/403.svg
913
923
  - spec/dummy/public/error/410.svg
914
- - spec/dummy/public/error/timeout_2.svg
915
- - spec/dummy/public/error/404.svg
916
924
  - spec/dummy/public/error/401.svg
925
+ - spec/dummy/public/error/404.svg
917
926
  - spec/dummy/public/error/500.svg
927
+ - spec/dummy/public/error/timeout_1.svg
928
+ - spec/dummy/public/error/timeout_3.svg
929
+ - spec/dummy/public/error/timeout_2.svg
918
930
  - spec/dummy/config.ru
919
- - spec/dummy/package.json
920
- - spec/capybara_helper.rb
921
- - spec/controllers/discussions_controller_spec.rb
922
- - spec/controllers/courses_api_controller_spec.rb
923
- - spec/controllers/organizations_api_controller_spec.rb
924
- - spec/controllers/discussions_messages_controller_spec.rb
925
- - spec/controllers/exercise_solutions_controller_spec.rb
926
- - spec/controllers/api_clients_controller.rb
927
- - spec/controllers/chapters_controller_spec.rb
928
- - spec/controllers/students_api_controller_spec.rb
929
- - spec/controllers/users_controller_spec.rb
930
- - spec/controllers/guide_progress_controller_spec.rb
931
- - spec/controllers/invitations_controller_spec.rb
932
- - spec/controllers/users_api_controller_spec.rb
933
- - spec/controllers/messages_controller_spec.rb
934
- - spec/controllers/confirmations_controller_spec.rb
935
- - spec/spec_helper.rb
936
- - spec/features/exercise_flow_spec.rb
937
- - spec/features/not_found_private_flow_spec.rb
938
- - spec/features/home_private_flow_spec.rb
939
- - spec/features/guide_reset_spec.rb
931
+ - spec/dummy/db/schema.rb
932
+ - spec/dummy/db/seeds.rb
933
+ - spec/dummy/config/application.rb
934
+ - spec/dummy/config/boot.rb
935
+ - spec/dummy/config/initializers/filter_parameter_logging.rb
936
+ - spec/dummy/config/initializers/cookies_serializer.rb
937
+ - spec/dummy/config/initializers/wrap_parameters.rb
938
+ - spec/dummy/config/initializers/assets.rb
939
+ - spec/dummy/config/puma.rb
940
+ - spec/dummy/config/environments/development.rb
941
+ - spec/dummy/config/environments/test.rb
942
+ - spec/dummy/config/database.yml
943
+ - spec/dummy/config/locales/en.yml
944
+ - spec/dummy/config/secrets.yml
945
+ - spec/dummy/config/environment.rb
946
+ - spec/dummy/config/spring.rb
947
+ - spec/dummy/config/cable.yml
948
+ - spec/dummy/config/rabbit.yml
949
+ - spec/dummy/config/routes.rb
950
+ - spec/dummy/Rakefile
951
+ - spec/api_helper.rb
940
952
  - spec/features/profile_flow_spec.rb
941
- - spec/features/terms_flow_spec.rb
953
+ - spec/features/not_found_public_flow_spec.rb
954
+ - spec/features/home_private_flow_spec.rb
955
+ - spec/features/login_flow_spec.rb
942
956
  - spec/features/links_flow_spec.rb
943
- - spec/features/invitations_flow_spec.rb
957
+ - spec/features/complements_flow_spec.rb
958
+ - spec/features/notifications_flow_spec.rb
959
+ - spec/features/topic_flow_spec.rb
960
+ - spec/features/guide_reset_spec.rb
961
+ - spec/features/menu_bar_spec.rb
962
+ - spec/features/disabled_organization_flow_spec.rb
963
+ - spec/features/dynamic_exam_spec.rb
944
964
  - spec/features/standard_flow_spec.rb
945
- - spec/features/login_flow_spec.rb
965
+ - spec/features/home_public_flow_spec.rb
966
+ - spec/features/chapters_flow_spec.rb
967
+ - spec/features/not_found_private_flow_spec.rb
968
+ - spec/features/immersive_redirection_spec.rb
969
+ - spec/features/terms_flow_spec.rb
946
970
  - spec/features/progressive_tips_spec.rb
947
971
  - spec/features/lessons_flow_spec.rb
948
972
  - spec/features/disable_user_flow_spec.rb
949
- - spec/features/runner_assets_spec.rb
950
- - spec/features/home_public_flow_spec.rb
951
- - spec/features/not_found_public_flow_spec.rb
973
+ - spec/features/invitations_flow_spec.rb
952
974
  - spec/features/guides_flow_spec.rb
953
- - spec/features/disabled_organization_flow_spec.rb
954
- - spec/features/dynamic_exam_spec.rb
955
- - spec/features/exams_flow_spec.rb
956
- - spec/features/topic_flow_spec.rb
957
- - spec/features/chapters_flow_spec.rb
975
+ - spec/features/runner_assets_spec.rb
958
976
  - spec/features/discussion_flow_spec.rb
959
- - spec/features/menu_bar_spec.rb
960
- - spec/features/immersive_redirection_spec.rb
961
- - spec/features/complements_flow_spec.rb
962
- - spec/login_helper.rb
963
- - spec/teaspoon_env.rb
964
- - spec/evaluation_helper.rb
965
- - spec/helpers/icons_helper_spec.rb
966
- - spec/helpers/with_navigation_spec.rb
967
- - spec/helpers/with_choices_spec.rb
968
- - spec/helpers/avatar_helper_spec.rb
969
- - spec/helpers/email_helper_spec.rb
970
- - spec/helpers/exercise_input_helper_spec.rb
971
- - spec/helpers/breadcrumbs_helper_spec.rb
972
- - spec/helpers/test_results_rendering_spec.rb
973
- - spec/helpers/page_title_helper_spec.rb
974
- - spec/helpers/authors_helper_spec.rb
975
- - spec/helpers/application_helper_spec.rb
976
- - spec/javascripts/events-spec.js
977
- - spec/javascripts/editors-spec.js
977
+ - spec/features/exercise_flow_spec.rb
978
+ - spec/features/exams_flow_spec.rb
979
+ - spec/javascripts/i18n-spec.js
980
+ - spec/javascripts/bridge-spec.js
981
+ - spec/javascripts/timeout-spec.js
982
+ - spec/javascripts/results-renderers-spec.js
978
983
  - spec/javascripts/kids-button-spec.js
979
984
  - spec/javascripts/timer-spec.js
980
- - spec/javascripts/spec-helper.js
981
- - spec/javascripts/global-spec.js
982
- - spec/javascripts/submissions-store-spec.js
983
- - spec/javascripts/results-renderers-spec.js
984
- - spec/javascripts/speech-bubble-renderer-spec.js
985
- - spec/javascripts/csrf-token-spec.js
986
985
  - spec/javascripts/sync-mode-spec.js
987
- - spec/javascripts/bridge-spec.js
988
- - spec/javascripts/i18n-spec.js
989
- - spec/javascripts/elipsis-spec.js
986
+ - spec/javascripts/events-spec.js
987
+ - spec/javascripts/editors-spec.js
990
988
  - spec/javascripts/exercise-spec.js
991
- - spec/javascripts/timeout-spec.js
989
+ - spec/javascripts/elipsis-spec.js
990
+ - spec/javascripts/spec-helper.js
991
+ - spec/javascripts/submissions-store-spec.js
992
992
  - spec/javascripts/gamification-spec.js
993
+ - spec/javascripts/csrf-token-spec.js
994
+ - spec/javascripts/global-spec.js
995
+ - spec/javascripts/speech-bubble-renderer-spec.js
996
+ - spec/teaspoon_env.rb
997
+ - spec/helpers/exercise_input_helper_spec.rb
998
+ - spec/helpers/application_helper_spec.rb
999
+ - spec/helpers/page_title_helper_spec.rb
1000
+ - spec/helpers/with_navigation_spec.rb
1001
+ - spec/helpers/authors_helper_spec.rb
1002
+ - spec/helpers/email_helper_spec.rb
1003
+ - spec/helpers/with_choices_spec.rb
1004
+ - spec/helpers/avatar_helper_spec.rb
1005
+ - spec/helpers/icons_helper_spec.rb
1006
+ - spec/helpers/test_results_rendering_spec.rb
1007
+ - spec/helpers/breadcrumbs_helper_spec.rb