mumuki-laboratory 7.0.3 → 7.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/concerns/users_controller_template.rb +3 -3
- data/app/controllers/concerns/with_user_params.rb +11 -0
- data/app/controllers/users_controller.rb +2 -4
- data/lib/mumuki/laboratory/locales/en.yml +1 -1
- data/lib/mumuki/laboratory/locales/es.yml +1 -1
- data/lib/mumuki/laboratory/locales/pt.yml +1 -1
- data/lib/mumuki/laboratory/version.rb +1 -1
- data/spec/controllers/guide_progress_controller_spec.rb +27 -8
- data/spec/features/exams_flow_spec.rb +1 -1
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 35d6e7523373cf000fe2e8e35c96946dc5ddbd334567c7b22c7e9820ead7097f
|
4
|
+
data.tar.gz: 734d4681ae46c1390f2aefb86a176142016669fedc748ba8e101a85b80ebd230
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 622309fc919269e770a944125a09ea39f5e54a03d4d7b520bc836a005040c424ef47f1f74726bcc5b70056a98fea6004723f9e9157d4a24417d8423bcc323495
|
7
|
+
data.tar.gz: 21afdd2eeba34d58e3333e3b957336d40be30418032342c99c3be7dc6d1cb84b2971e274601ba72c9cc87ef79f154fe4bc8d391a12084f9b9f75186d1faf44e6
|
@@ -1,5 +1,6 @@
|
|
1
1
|
module UsersControllerTemplate
|
2
2
|
extend ActiveSupport::Concern
|
3
|
+
include WithUserParams
|
3
4
|
|
4
5
|
included do
|
5
6
|
before_action :set_user!, only: [:show, :update]
|
@@ -13,8 +14,8 @@ module UsersControllerTemplate
|
|
13
14
|
current_user.protect_permissions_assignment! user_params[:permissions], @user.permissions_was
|
14
15
|
end
|
15
16
|
|
16
|
-
def
|
17
|
-
|
17
|
+
def permissible_params
|
18
|
+
super + [:email, :image_url, permissions: Mumukit::Auth::Roles::ROLES]
|
18
19
|
end
|
19
20
|
|
20
21
|
def set_user!
|
@@ -24,5 +25,4 @@ module UsersControllerTemplate
|
|
24
25
|
def set_new_user!
|
25
26
|
@user = User.new user_params
|
26
27
|
end
|
27
|
-
|
28
28
|
end
|
@@ -1,4 +1,6 @@
|
|
1
1
|
class UsersController < ApplicationController
|
2
|
+
include WithUserParams
|
3
|
+
|
2
4
|
before_action :authenticate!
|
3
5
|
before_action :set_user!
|
4
6
|
|
@@ -24,10 +26,6 @@ class UsersController < ApplicationController
|
|
24
26
|
def validate_user_profile!
|
25
27
|
end
|
26
28
|
|
27
|
-
def user_params
|
28
|
-
params.require(:user).permit(User.profile_fields)
|
29
|
-
end
|
30
|
-
|
31
29
|
def set_user!
|
32
30
|
@user = current_user
|
33
31
|
end
|
@@ -86,7 +86,7 @@ en:
|
|
86
86
|
forbidden_explanation: You are not allowed to see this content.
|
87
87
|
gender: Gender
|
88
88
|
go_to: 'Go to %{organization}'
|
89
|
-
gone_explanation: This
|
89
|
+
gone_explanation: This content is no longer available.
|
90
90
|
guide: Guide
|
91
91
|
guide_created: Guide created successfully
|
92
92
|
guide_finished: You completed %{guide}!
|
@@ -94,7 +94,7 @@ es:
|
|
94
94
|
forbidden_explanation: Es decir que no tenés autorización para ver este contenido. <br> ¿Puede que hayas ingresado con una cuenta incorrecta?
|
95
95
|
gender: Género
|
96
96
|
go_to: 'Ir a %{organization}'
|
97
|
-
gone_explanation: ¡Ups! Esto es lo que se conoce como %{error}, es decir que ya no podés ver este
|
97
|
+
gone_explanation: ¡Ups! Esto es lo que se conoce como %{error}, es decir que ya no podés ver este contenido.
|
98
98
|
guide: Lección
|
99
99
|
guide_created: Guía creada exitosamente
|
100
100
|
guide_finished: ¡Terminaste %{guide}!
|
@@ -91,7 +91,7 @@ pt:
|
|
91
91
|
gender: Gênero
|
92
92
|
get_messages: Ver mensagens
|
93
93
|
go_to: Vá para %{organization}
|
94
|
-
gone_explanation: Opa! Isto é o que é conhecido como %{error}, ou seja, você não pode mais ver esse
|
94
|
+
gone_explanation: Opa! Isto é o que é conhecido como %{error}, ou seja, você não pode mais ver esse conteúdo.
|
95
95
|
guide: Lição
|
96
96
|
guide_created: Guia criado com sucesso
|
97
97
|
guide_finished: Você terminou %{guide}!
|
@@ -5,17 +5,36 @@ describe GuideProgressController, organization_workspace: :test do
|
|
5
5
|
|
6
6
|
let(:exam_problem) { build(:problem) }
|
7
7
|
let(:test_organization) { Organization.find_by_name('test') }
|
8
|
-
let(:exam) { create(:exam, organization: test_organization, guide:
|
9
|
-
let(:
|
10
|
-
|
11
|
-
before { exam.index_usage! test_organization }
|
12
|
-
|
13
|
-
before { reindex_current_organization! }
|
8
|
+
let(:exam) { create(:exam, organization: test_organization, guide: exam_guide) }
|
9
|
+
let(:lesson) { create(:lesson, guide: lesson_guide) }
|
14
10
|
|
15
11
|
describe 'delete' do
|
16
12
|
before { set_current_user! user }
|
17
|
-
before { delete :destroy, params: { guide_id: guide.id } }
|
18
13
|
|
19
|
-
|
14
|
+
describe 'an exam guide progress' do
|
15
|
+
let(:exam_guide) { create(:guide, exercises: [exam_problem])}
|
16
|
+
before { exam.index_usage! test_organization }
|
17
|
+
before { reindex_current_organization! }
|
18
|
+
before { delete :destroy, params: { guide_id: exam_guide.id } }
|
19
|
+
|
20
|
+
it { expect(response.status).to eq 403 }
|
21
|
+
end
|
22
|
+
|
23
|
+
describe 'a lesson guide progress' do
|
24
|
+
let(:book) { create(:book,
|
25
|
+
slug: 'mumuki/book',
|
26
|
+
chapters: [
|
27
|
+
create(:chapter,
|
28
|
+
slug: 'mumuki/topic1',
|
29
|
+
lessons: [lesson])]) }
|
30
|
+
|
31
|
+
let(:lesson_guide) { create(:guide, exercises: [exam_problem])}
|
32
|
+
before { test_organization.update! book: book }
|
33
|
+
before { lesson.index_usage! test_organization }
|
34
|
+
before { reindex_current_organization! }
|
35
|
+
before { delete :destroy, params: { guide_id: lesson_guide.id } }
|
36
|
+
|
37
|
+
it { expect(response.status).to eq 302 }
|
38
|
+
end
|
20
39
|
end
|
21
40
|
end
|
@@ -51,7 +51,7 @@ feature 'Exams Flow', organization_workspace: :test do
|
|
51
51
|
expect_any_instance_of(Exam).to receive(:enabled_for?).and_return(false)
|
52
52
|
visit "/exams/#{exam.classroom_id}"
|
53
53
|
|
54
|
-
expect(page).to have_text('This
|
54
|
+
expect(page).to have_text('This content is no longer available.')
|
55
55
|
end
|
56
56
|
|
57
57
|
scenario 'visit exercise for exam with no submission limits' do
|
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: 7.0.
|
4
|
+
version: 7.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Franco Bulgarelli
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-08-
|
11
|
+
date: 2019-08-15 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: 7.0.
|
33
|
+
version: 7.0.1
|
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: 7.0.
|
40
|
+
version: 7.0.1
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: mumukit-login
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -278,6 +278,7 @@ files:
|
|
278
278
|
- app/controllers/concerns/users_controller_template.rb
|
279
279
|
- app/controllers/concerns/with_authorization.rb
|
280
280
|
- app/controllers/concerns/with_errors_filter.rb
|
281
|
+
- app/controllers/concerns/with_user_params.rb
|
281
282
|
- app/controllers/discussions_controller.rb
|
282
283
|
- app/controllers/discussions_messages_controller.rb
|
283
284
|
- app/controllers/exams_controller.rb
|