unidom-authorization 1.6.2 → 1.6.3
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 26ac76c78d67b833e19af1c0b048c614f1157f41
|
4
|
+
data.tar.gz: d432d272b5da0bcdf22f2b427b1eb629854ff357
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e5a3334dbf314e434f882b894577a5fe8f4d4d3b03ad3445a52e52197fc370647581bbbd0aef6a70cd36534236d5533178ae61721b507e282fcb534a251cd3d8
|
7
|
+
data.tar.gz: 0d912248ad264d28c17350e4d177918d4da9725343bb5ebff8071c36bd783eae683a063d76ada4a1e8f6434650068c33ab401d38bd10b078010da45e6fa2a1b9
|
@@ -13,8 +13,45 @@ 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
|
18
|
+
|
16
19
|
it_behaves_like 'Unidom::Common::Concerns::ModelExtension', model_attributes
|
17
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
|
54
|
+
|
18
55
|
it_behaves_like 'scope', :path_is, [
|
19
56
|
{ attributes_collection: [ model_attributes ], count_diff: 1, args: [ model_attributes[:path] ] },
|
20
57
|
{ attributes_collection: [ model_attributes ], count_diff: 0, args: [ "/#{model_attributes[:path]}" ] },
|
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.
|
4
|
+
version: 1.6.3
|
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-
|
11
|
+
date: 2017-03-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: unidom-common
|