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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 366496483071b755211e3ad71000a4bd83c9f7f2
4
- data.tar.gz: 7c19fec4ead6a2c20e9e5a118ae9bb8d7d6a98ea
3
+ metadata.gz: 1d9d3ba887d5b12ebe41de41f57444fb1a5b3bbd
4
+ data.tar.gz: bfdd91560121820e95afc92c63d158ba315ca424
5
5
  SHA512:
6
- metadata.gz: 680dfd545b9969e420e0ae7a4880b1f7b552124a6af5481977ff1b0b960308aa4a8a6136afdf85b6a8928ab07018f6cad7c9c0910adc48a644d8cd71871a1a7d
7
- data.tar.gz: 7fada9f8789a68ee2d2368ec0039b46f0abeee0d7618cffe1da6249b205abba744417addd48359f91b61209a1bcc5c507ccc475a6155536ed194006e8844c1df
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 id
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 id
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 mock_id = "abunchofcrap"
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(:id).and_return(mock_id.to_s)
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?)
@@ -1,3 +1,3 @@
1
1
  module Bouncer
2
- VERSION = "0.2.2"
2
+ VERSION = "0.2.3"
3
3
  end
@@ -17,7 +17,7 @@ describe Bouncer::ControllerMixin do
17
17
  end
18
18
 
19
19
  describe "#authenticate_super_admin!" do
20
- before do
20
+ before do
21
21
  stub_authorization 'Bearer stuff'
22
22
  end
23
23
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bouncer-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kurt Nelson