mumuki-laboratory 7.0.8 → 7.0.9

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 15d2276b836a336c2989126b7186c98e37ce701b5d7ef36a741e3d0e7928a83a
4
- data.tar.gz: a09c493ac5170e29d1a8ac12f68518d31d82e07cff5bf72b82f90f85ce6c16b5
3
+ metadata.gz: d4d336ad84b2c7da871c2d197b57744ae45e798b637340bff530045c9077d720
4
+ data.tar.gz: 94191df5d2841b0465efbcbbbc5e3c60a54e52987b4f1bb280289324c0d79b27
5
5
  SHA512:
6
- metadata.gz: 94bafdaf9579bf035a4000db528d73a8d4e6e34ca1645e4d9f98d590ecc8a25dc953a37309d49341f81fb89f6de34f8adea7c509b4ea4dfcbd3c359bc1e187f5
7
- data.tar.gz: 5093708e9b15fbe57578d467397ad76a85893b3bb79abd74bc401e1017574c37d1735bf9d62f02bb00752c08b94aa4eca3161633b834df669323e18fd34fd779
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(:first_name, :last_name, :email, :uid, :image_url)
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!
@@ -1,5 +1,5 @@
1
1
  module Mumuki
2
2
  module Laboratory
3
- VERSION = '7.0.8'
3
+ VERSION = '7.0.9'
4
4
  end
5
5
  end
@@ -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.8
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-19 00:00:00.000000000 Z
11
+ date: 2019-09-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails