unidom-authorization 1.6.3 → 1.6.4

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
  SHA1:
3
- metadata.gz: 26ac76c78d67b833e19af1c0b048c614f1157f41
4
- data.tar.gz: d432d272b5da0bcdf22f2b427b1eb629854ff357
3
+ metadata.gz: 3568ebd88446fc27c74531f257542975c762ba9c
4
+ data.tar.gz: dc0dfbe997f95d450c36fea8d0873d0339589a28
5
5
  SHA512:
6
- metadata.gz: e5a3334dbf314e434f882b894577a5fe8f4d4d3b03ad3445a52e52197fc370647581bbbd0aef6a70cd36534236d5533178ae61721b507e282fcb534a251cd3d8
7
- data.tar.gz: 0d912248ad264d28c17350e4d177918d4da9725343bb5ebff8071c36bd783eae683a063d76ada4a1e8f6434650068c33ab401d38bd10b078010da45e6fa2a1b9
6
+ metadata.gz: b219f04d33a5d2843d52150c18d23df28c6b3b574708cdc3e0d7cd7ad865f12797530a9c2d4dfe9aaba6c78fcd77de8346f6402fb56afc37f31ad25ad33696d5
7
+ data.tar.gz: 40439c9818217bb11338ecb9b12abd158be4919230f94d93af6c945c503fb665c3502aa66dc2e3678a61c25e0efce24ff4d88f2224426e29794ca725a797cb51
@@ -25,11 +25,7 @@ describe Unidom::Authorization::Authorizing, type: :model do
25
25
 
26
26
  it_behaves_like 'belongs_to', model_attributes, :permission, Unidom::Authorization::Permission, permission_attributes
27
27
 
28
- it_behaves_like 'scope', :permission_is, [
29
- { attributes_collection: [ model_attributes ], count_diff: 1, args: [ model_attributes[:permission_id] ] },
30
- { attributes_collection: [ model_attributes ], count_diff: 1, args: [ Unidom::Authorization::Permission.new(id: model_attributes[:permission_id]) ] },
31
- { attributes_collection: [ model_attributes ], count_diff: 0, args: [ model_attributes[:authorized_id] ] },
32
- { attributes_collection: [ model_attributes ], count_diff: 0, args: [ Unidom::Authorization::Permission.new(id: model_attributes[:authorized_id]) ] } ]
28
+ it_behaves_like 'monomorphic scope', model_attributes, :permission_is, :permission
33
29
 
34
30
  end
35
31
 
@@ -13,44 +13,13 @@ describe Unidom::Authorization::Permission, type: :model do
13
13
  path: 'users'
14
14
  }
15
15
 
16
- name_max_length = described_class.columns_hash['name'].limit
17
- path_max_length = described_class.columns_hash['path'].limit
16
+ #name_max_length = described_class.columns_hash['name'].limit
17
+ #path_max_length = described_class.columns_hash['path'].limit
18
18
 
19
19
  it_behaves_like 'Unidom::Common::Concerns::ModelExtension', model_attributes
20
20
 
21
- it_behaves_like 'validates', model_attributes, :name,
22
- { } => 0,
23
- { name: nil } => 2,
24
- { name: '' } => 2,
25
- { name: '1' } => 1,
26
- { name: 'A' } => 1,
27
- { name: '11' } => 0,
28
- { name: 'AA' } => 0,
29
- { name: '111' } => 0,
30
- { name: 'AAA' } => 0,
31
- { name: '1'*(name_max_length-1) } => 0,
32
- { name: 'A'*(name_max_length-1) } => 0,
33
- { name: '1'*name_max_length } => 0,
34
- { name: 'A'*name_max_length } => 0,
35
- { name: '1'*(name_max_length+1) } => 1,
36
- { name: 'A'*(name_max_length+1) } => 1
37
-
38
- it_behaves_like 'validates', model_attributes, :path,
39
- { } => 0,
40
- { path: nil } => 0,
41
- { path: '' } => 0,
42
- { path: '1' } => 1,
43
- { path: 'A' } => 1,
44
- { path: '11' } => 0,
45
- { path: 'AA' } => 0,
46
- { path: '111' } => 0,
47
- { path: 'AAA' } => 0,
48
- { path: '1'*(path_max_length-1) } => 0,
49
- { path: 'A'*(path_max_length-1) } => 0,
50
- { path: '1'*path_max_length } => 0,
51
- { path: 'A'*path_max_length } => 0,
52
- { path: '1'*(path_max_length+1) } => 1,
53
- { path: 'A'*(path_max_length+1) } => 1
21
+ it_behaves_like 'validates text', model_attributes, :name, length: 2..described_class.columns_hash['name'].limit
22
+ it_behaves_like 'validates text', model_attributes, :path, length: 2..described_class.columns_hash['path'].limit
54
23
 
55
24
  it_behaves_like 'scope', :path_is, [
56
25
  { attributes_collection: [ model_attributes ], count_diff: 1, args: [ model_attributes[:path] ] },
@@ -1,5 +1,5 @@
1
1
  module Unidom
2
2
  module Authorization
3
- VERSION = '1.6.3'.freeze
3
+ VERSION = '1.6.4'.freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: unidom-authorization
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.3
4
+ version: 1.6.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Topbit Du
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-03-08 00:00:00.000000000 Z
11
+ date: 2017-03-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: unidom-common