unidom-authorization 1.6.2 → 1.6.3

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
  SHA1:
3
- metadata.gz: 7f606e2b92a57d5ec745cda441d7da33b79a484e
4
- data.tar.gz: 96ff8f3d4af000942776552800b59ef9359ba1ff
3
+ metadata.gz: 26ac76c78d67b833e19af1c0b048c614f1157f41
4
+ data.tar.gz: d432d272b5da0bcdf22f2b427b1eb629854ff357
5
5
  SHA512:
6
- metadata.gz: b11a0816e6003a8de6ddd30ac71c1e9bc7292e0e6dcc597b706d9044c06458135f9159d03af4662862d328af73f061efcbae3384f802ebe86fbf7678fa5a499d
7
- data.tar.gz: 409daacaea1c2d3c8de54626a5d8945e5d131f1d2ffbd66655887f9013e230670933d30955264b089c05dd11306d58ed243a20cc6bb7695f9e5b651644e77e70
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]}" ] },
@@ -1,5 +1,5 @@
1
1
  module Unidom
2
2
  module Authorization
3
- VERSION = '1.6.2'.freeze
3
+ VERSION = '1.6.3'.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.2
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-02 00:00:00.000000000 Z
11
+ date: 2017-03-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: unidom-common