mumuki-laboratory 7.0.8 → 7.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: d4d336ad84b2c7da871c2d197b57744ae45e798b637340bff530045c9077d720
|
|
4
|
+
data.tar.gz: 94191df5d2841b0465efbcbbbc5e3c60a54e52987b4f1bb280289324c0d79b27
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 862002b05967676245a1dcf3ad992fb9fc8923bda4075019be80d58d9d16131f5df1c5bc2d6e306a4e72ddb4ddaa7ddc3b25b835a9e2d6f2a36057cff3e72643
|
|
7
|
+
data.tar.gz: abc1bb8c4fb6607aff0fe3f89dbea8dd1c676b71b6450b25a83179f8c211619ca240acfaf2ddfa39f060f01e9a89bea205ccd6db82ca26f35532b2266616a224
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
module Api
|
|
2
2
|
class RolesController < BaseController
|
|
3
|
+
include WithUserParams
|
|
4
|
+
|
|
3
5
|
before_action :set_slug!
|
|
4
6
|
before_action :set_course!
|
|
5
7
|
before_action :set_user!, except: :create
|
|
@@ -28,7 +30,11 @@ module Api
|
|
|
28
30
|
end
|
|
29
31
|
|
|
30
32
|
def user_params
|
|
31
|
-
params.require(role).permit(
|
|
33
|
+
params.require(role).permit(*permissible_params)
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
def permissible_params
|
|
37
|
+
super + [:image_url, :email, :uid]
|
|
32
38
|
end
|
|
33
39
|
|
|
34
40
|
def set_course!
|
|
@@ -9,7 +9,9 @@ require 'spec_helper'
|
|
|
9
9
|
first_name: 'Agustin',
|
|
10
10
|
last_name: 'Pina',
|
|
11
11
|
email: 'agus@mumuki.org',
|
|
12
|
-
uid: 'agus@mumuki.org'
|
|
12
|
+
uid: 'agus@mumuki.org',
|
|
13
|
+
gender: 'male',
|
|
14
|
+
birthdate: '2010-08-25'
|
|
13
15
|
} }
|
|
14
16
|
|
|
15
17
|
let!(:organization) { create :organization, name: 'anorganization' }
|
|
@@ -28,9 +30,12 @@ require 'spec_helper'
|
|
|
28
30
|
it { expect(User.last.first_name).to eq 'Agustin' }
|
|
29
31
|
it { expect(User.last.uid).to eq 'agus@mumuki.org' }
|
|
30
32
|
it { expect(User.last.email).to eq 'agus@mumuki.org' }
|
|
33
|
+
it { expect(User.last.gender).to eq 'male' }
|
|
34
|
+
it { expect(User.last.birthdate).to eq '2010-08-25'.to_datetime }
|
|
31
35
|
it { expect(User.last.permissions.has_permission? role, 'anorganization/acode').to be true }
|
|
32
36
|
|
|
33
37
|
end
|
|
38
|
+
|
|
34
39
|
context 'when user exist' do
|
|
35
40
|
context 'and have no permissions' do
|
|
36
41
|
before { create :user, json }
|
|
@@ -39,6 +44,7 @@ require 'spec_helper'
|
|
|
39
44
|
it { expect(User.count).to eq 2 }
|
|
40
45
|
it { expect(User.last.permissions.has_permission? role, 'anorganization/acode').to be true }
|
|
41
46
|
end
|
|
47
|
+
|
|
42
48
|
context 'and have permissions' do
|
|
43
49
|
before { create :user, json.merge(:permissions => {role => 'foo/bar'}) }
|
|
44
50
|
before { post :create, params: params }
|
|
@@ -48,7 +54,6 @@ require 'spec_helper'
|
|
|
48
54
|
it { expect(User.last.permissions.has_permission? role, 'foo/bar').to be true }
|
|
49
55
|
end
|
|
50
56
|
|
|
51
|
-
|
|
52
57
|
end
|
|
53
58
|
end
|
|
54
59
|
|
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.9
|
|
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-09-
|
|
11
|
+
date: 2019-09-23 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rails
|