unidom-authorization 1.6.7 → 1.6.8

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: c4ae7ccc5485c17a50a314cce47f8151bbe39710
4
- data.tar.gz: faec9876608008e19f4150f45a502b67b912544f
3
+ metadata.gz: ff9f8b52affaacbf3946c01061e4102bec04468b
4
+ data.tar.gz: 1c49adc7c942820c0462623ebce4579d07dab579
5
5
  SHA512:
6
- metadata.gz: ae90a1ce3ac29cdde27994758081beddd9047ebff4465ef92137cf5b513cc8c0ec92f020fac5c26e01ef3ff62dfd16498aee7ecdcd6316ff16308911b14b9800
7
- data.tar.gz: 7ce92fd4a31dc53da01550c3666e6a209238244f78ca7c938ed17884b06fe921d5d67fb6c17aaf4aed859508437a109233617d17a856efd736152df299f79f70
6
+ metadata.gz: 8c43d6c7f8714f3580dd3f033e6026897fc5479ecee46852c10de99e018c3ffcd9f882493671730a32d60580c8f4c3d1e6cba03006b2908a7c039984971ef29a
7
+ data.tar.gz: 36df0efd33ee7e4ea3c77a0ec88c3cbe99bf59df7e0523384f362d12ff10a71f47bbe1d95239e93a726fad64f7f0a239f8846b90e1c4a3b09b6e64ad2611d8f9
@@ -41,6 +41,32 @@ shared_examples 'Unidom::Authorization::Concerns::AsAuthorized' do |model_attrib
41
41
 
42
42
  end
43
43
 
44
+ context '#is_prohibited!' do
45
+
46
+ it "should be able to be prohibited" do
47
+ authorizing = @authorized.is_authorized! permission: permission, by: authorizer
48
+ expect(authorizing).to be_present
49
+ expect(authorizing).to be_a(Unidom::Authorization::Authorizing)
50
+ expect(authorizing).not_to be_new_record
51
+
52
+ prohibiting = @authorized.is_prohibited! permission: permission
53
+ expect(prohibiting).to be_present
54
+ expect(prohibiting).to eq(1)
55
+ end
56
+
57
+ it "should be able to be prohibited at #{Time.now.inspect}" do
58
+ authorizing = @authorized.is_authorized! permission: permission, by: authorizer, at: Time.now
59
+ expect(authorizing).to be_present
60
+ expect(authorizing).to be_a(Unidom::Authorization::Authorizing)
61
+ expect(authorizing).not_to be_new_record
62
+
63
+ prohibiting = @authorized.is_prohibited! permission: permission, at: Time.now
64
+ expect(prohibiting).to be_present
65
+ expect(prohibiting).to eq(1)
66
+ end
67
+
68
+ end
69
+
44
70
  context do
45
71
 
46
72
  authorizing_1_attribtues = {
@@ -41,6 +41,32 @@ shared_examples 'Unidom::Authorization::Concerns::AsPermission' do |model_attrib
41
41
 
42
42
  end
43
43
 
44
+ context '#prohibit!' do
45
+
46
+ it "should be able to prohibit #{authorized.inspect}" do
47
+ authorizing = @permission.authorize! authorized, by: authorizer
48
+ expect(authorizing).to be_present
49
+ expect(authorizing).to be_a(Unidom::Authorization::Authorizing)
50
+ expect(authorizing).not_to be_new_record
51
+
52
+ prohibiting = @permission.prohibit! authorized
53
+ expect(prohibiting).to be_present
54
+ expect(prohibiting).to eq(1)
55
+ end
56
+
57
+ it "should be able to prohibit #{authorized.inspect} at #{Time.now.inspect}" do
58
+ authorizing = @permission.authorize! authorized, by: authorizer, at: Time.now
59
+ expect(authorizing).to be_present
60
+ expect(authorizing).to be_a(Unidom::Authorization::Authorizing)
61
+ expect(authorizing).not_to be_new_record
62
+
63
+ prohibiting = @permission.prohibit! authorized, at: Time.now
64
+ expect(prohibiting).to be_present
65
+ expect(prohibiting).to eq(1)
66
+ end
67
+
68
+ end
69
+
44
70
  context do
45
71
 
46
72
  authorizing_1_attribtues = {
@@ -1,5 +1,5 @@
1
1
  module Unidom
2
2
  module Authorization
3
- VERSION = '1.6.7'.freeze
3
+ VERSION = '1.6.8'.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.7
4
+ version: 1.6.8
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-04-10 00:00:00.000000000 Z
11
+ date: 2017-04-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: unidom-common