bouncer-client 0.2.2 → 0.2.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 +4 -4
- data/lib/bouncer-client/test_helpers.rb +11 -5
- data/lib/bouncer-client/version.rb +1 -1
- data/spec/mixins/controller_mixin_spec.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1d9d3ba887d5b12ebe41de41f57444fb1a5b3bbd
|
4
|
+
data.tar.gz: bfdd91560121820e95afc92c63d158ba315ca424
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f3f5199051963353c2f2076ee98157b6b28a15ffc076bf214f0fc74ed668dba4f017d2ae400d3ceba87d6b26767f717d24a1faf5d88d4c1ab5e1aad686ca1b07
|
7
|
+
data.tar.gz: 8caeb5b8dac45bfcf60bfc17b70ac03a14bdfd930cccc4c1169a7e39d5f13866a7a17ce2ba8fe32d1c05b5e59ca4bb780c86bd3bdeddb49245d0e89cae7d5b69
|
@@ -2,26 +2,32 @@ module Bouncer
|
|
2
2
|
module TestHelpers
|
3
3
|
def super_admin_token id = SecureRandom.uuid
|
4
4
|
token = user_token id
|
5
|
-
allow(token).to receive(:super_admin?).and_return(true)
|
5
|
+
allow(token.user).to receive(:super_admin?).and_return(true)
|
6
6
|
token
|
7
7
|
end
|
8
8
|
|
9
9
|
def user_token id = SecureRandom.uuid
|
10
|
-
token = valid_token
|
10
|
+
token = valid_token
|
11
11
|
allow(token).to receive(:user?).and_return(true)
|
12
|
+
allow(token).to receive(:user).and_return(double "Bouncer::User")
|
13
|
+
allow(token.user).to receive(:id).and_return(id)
|
14
|
+
allow(token.user).to receive(:super_admin?).and_return(false)
|
12
15
|
token
|
13
16
|
end
|
14
17
|
|
15
18
|
def machine_token id = SecureRandom.uuid
|
16
|
-
token = valid_token
|
19
|
+
token = valid_token
|
20
|
+
device = double("Bouncer::Device")
|
21
|
+
allow(device).to receive(:id).and_return(id)
|
17
22
|
allow(token).to receive(:device?).and_return(true)
|
23
|
+
allow(token).to receive(:device).and_return(device)
|
18
24
|
token
|
19
25
|
end
|
20
26
|
|
21
|
-
def valid_token
|
27
|
+
def valid_token
|
22
28
|
token = double("Bouncer::Token")
|
23
29
|
allow(token).to receive(:validate!).and_return(true)
|
24
|
-
allow(token).to receive(:
|
30
|
+
allow(token).to receive(:valid?).and_return(true)
|
25
31
|
allow(token).to receive(:device?)
|
26
32
|
allow(token).to receive(:user?)
|
27
33
|
allow(token).to receive(:super_admin?)
|