doorkeeper 1.0.0.rc2 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of doorkeeper might be problematic. Click here for more details.

Files changed (52) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +2 -1
  3. data/lib/doorkeeper/version.rb +1 -1
  4. data/spec/controllers/applications_controller_spec.rb +4 -4
  5. data/spec/controllers/authorizations_controller_spec.rb +9 -9
  6. data/spec/controllers/protected_resources_controller_spec.rb +10 -10
  7. data/spec/controllers/token_info_controller_spec.rb +4 -4
  8. data/spec/controllers/tokens_controller_spec.rb +4 -4
  9. data/spec/lib/config_spec.rb +21 -21
  10. data/spec/lib/models/expirable_spec.rb +13 -13
  11. data/spec/lib/models/revocable_spec.rb +5 -5
  12. data/spec/lib/models/scopes_spec.rb +3 -3
  13. data/spec/lib/oauth/authorization/uri_builder_spec.rb +5 -5
  14. data/spec/lib/oauth/authorization_code_request_spec.rb +7 -7
  15. data/spec/lib/oauth/client/credentials_spec.rb +8 -8
  16. data/spec/lib/oauth/client/methods_spec.rb +8 -8
  17. data/spec/lib/oauth/client_credentials/creator_spec.rb +2 -2
  18. data/spec/lib/oauth/client_credentials/issuer_spec.rb +10 -9
  19. data/spec/lib/oauth/client_credentials/validation_spec.rb +6 -6
  20. data/spec/lib/oauth/client_credentials_request_spec.rb +7 -7
  21. data/spec/lib/oauth/client_spec.rb +8 -8
  22. data/spec/lib/oauth/code_request_spec.rb +4 -4
  23. data/spec/lib/oauth/error_response_spec.rb +22 -15
  24. data/spec/lib/oauth/error_spec.rb +1 -1
  25. data/spec/lib/oauth/helpers/scope_checker_spec.rb +13 -13
  26. data/spec/lib/oauth/helpers/unique_token_spec.rb +2 -2
  27. data/spec/lib/oauth/helpers/uri_checker_spec.rb +13 -13
  28. data/spec/lib/oauth/invalid_token_response_spec.rb +9 -4
  29. data/spec/lib/oauth/password_access_token_request_spec.rb +7 -7
  30. data/spec/lib/oauth/pre_authorization_spec.rb +14 -14
  31. data/spec/lib/oauth/refresh_token_request_spec.rb +8 -8
  32. data/spec/lib/oauth/scopes_spec.rb +27 -19
  33. data/spec/lib/oauth/token_request_spec.rb +4 -4
  34. data/spec/lib/oauth/token_response_spec.rb +11 -11
  35. data/spec/lib/oauth/token_spec.rb +9 -9
  36. data/spec/lib/server_spec.rb +1 -1
  37. data/spec/models/doorkeeper/access_token_spec.rb +15 -15
  38. data/spec/models/doorkeeper/application_spec.rb +21 -21
  39. data/spec/requests/flows/authorization_code_spec.rb +1 -1
  40. data/spec/requests/flows/client_credentials_spec.rb +1 -1
  41. data/spec/requests/flows/refresh_token_spec.rb +6 -6
  42. data/spec/requests/protected_resources/private_api_spec.rb +3 -3
  43. data/spec/routing/custom_controller_routes_spec.rb +16 -16
  44. data/spec/routing/default_routes_spec.rb +7 -7
  45. data/spec/routing/scoped_routes_spec.rb +7 -7
  46. data/spec/support/helpers/authorization_request_helper.rb +3 -3
  47. data/spec/support/helpers/model_helper.rb +6 -6
  48. data/spec/support/helpers/request_spec_helper.rb +9 -9
  49. data/spec/support/shared/controllers_shared_context.rb +6 -6
  50. data/spec/support/shared/models_shared_examples.rb +6 -6
  51. data/spec/validators/redirect_uri_validator_spec.rb +12 -12
  52. metadata +4 -4
@@ -11,7 +11,7 @@ module Doorkeeper::OAuth
11
11
 
12
12
  describe :description do
13
13
  it 'is translated from translation messages' do
14
- I18n.should_receive(:translate).with(:some_error, :scope => [:doorkeeper, :errors, :messages])
14
+ expect(I18n).to receive(:translate).with(:some_error, :scope => [:doorkeeper, :errors, :messages])
15
15
  subject.description
16
16
  end
17
17
  end
@@ -12,30 +12,30 @@ module Doorkeeper::OAuth::Helpers
12
12
  it "true if scopes matches" do
13
13
  scopes = new_scope :public
14
14
  scopes_to_match = new_scope :public
15
- ScopeChecker.matches?(scopes, scopes_to_match).should be_true
15
+ expect(ScopeChecker.matches?(scopes, scopes_to_match)).to be_true
16
16
  end
17
17
 
18
18
  it "is false when scopes differs" do
19
19
  scopes = new_scope :public
20
20
  scopes_to_match = new_scope :write
21
- ScopeChecker.matches?(scopes, scopes_to_match).should be_false
21
+ expect(ScopeChecker.matches?(scopes, scopes_to_match)).to be_false
22
22
  end
23
23
 
24
24
  it "is false when scope in array is missing" do
25
25
  scopes = new_scope :public
26
26
  scopes_to_match = new_scope :public, :write
27
- ScopeChecker.matches?(scopes, scopes_to_match).should be_false
27
+ expect(ScopeChecker.matches?(scopes, scopes_to_match)).to be_false
28
28
  end
29
29
 
30
30
  it "is false when scope in string is missing" do
31
31
  scopes = new_scope :public, :write
32
32
  scopes_to_match = new_scope :public
33
- ScopeChecker.matches?(scopes, scopes_to_match).should be_false
33
+ expect(ScopeChecker.matches?(scopes, scopes_to_match)).to be_false
34
34
  end
35
35
 
36
36
  it "is false when any of attributes is nil" do
37
- ScopeChecker.matches?(nil, double).should be_false
38
- ScopeChecker.matches?(double, nil).should be_false
37
+ expect(ScopeChecker.matches?(nil, double)).to be_false
38
+ expect(ScopeChecker.matches?(double, nil)).to be_false
39
39
  end
40
40
  end
41
41
 
@@ -44,31 +44,31 @@ module Doorkeeper::OAuth::Helpers
44
44
 
45
45
  it "is valid if scope is present" do
46
46
  server_scopes.add :scope
47
- ScopeChecker.valid?("scope", server_scopes).should be_true
47
+ expect(ScopeChecker.valid?("scope", server_scopes)).to be_true
48
48
  end
49
49
 
50
50
  it "is invalid if includes tabs space" do
51
- ScopeChecker.valid?("\tsomething", server_scopes).should be_false
51
+ expect(ScopeChecker.valid?("\tsomething", server_scopes)).to be_false
52
52
  end
53
53
 
54
54
  it "is invalid if scope is not present" do
55
- ScopeChecker.valid?(nil, server_scopes).should be_false
55
+ expect(ScopeChecker.valid?(nil, server_scopes)).to be_false
56
56
  end
57
57
 
58
58
  it "is invalid if scope is blank" do
59
- ScopeChecker.valid?(" ", server_scopes).should be_false
59
+ expect(ScopeChecker.valid?(" ", server_scopes)).to be_false
60
60
  end
61
61
 
62
62
  it "is invalid if includes return space" do
63
- ScopeChecker.valid?("scope\r", server_scopes).should be_false
63
+ expect(ScopeChecker.valid?("scope\r", server_scopes)).to be_false
64
64
  end
65
65
 
66
66
  it "is invalid if includes new lines" do
67
- ScopeChecker.valid?("scope\nanother", server_scopes).should be_false
67
+ expect(ScopeChecker.valid?("scope\nanother", server_scopes)).to be_false
68
68
  end
69
69
 
70
70
  it "is invalid if any scope is not included in server scopes" do
71
- ScopeChecker.valid?("scope another", server_scopes).should be_false
71
+ expect(ScopeChecker.valid?("scope another", server_scopes)).to be_false
72
72
  end
73
73
  end
74
74
  end
@@ -9,12 +9,12 @@ module Doorkeeper::OAuth::Helpers
9
9
 
10
10
  it "is able to customize the generator method" do
11
11
  token = UniqueToken.generate(:generator => generator)
12
- token.should == "a" * 32
12
+ expect(token).to eq("a" * 32)
13
13
  end
14
14
 
15
15
  it "is able to customize the size of the token" do
16
16
  token = UniqueToken.generate(:generator => generator, :size => 2)
17
- token.should == "aa"
17
+ expect(token).to eq("aa")
18
18
  end
19
19
  end
20
20
  end
@@ -7,75 +7,75 @@ module Doorkeeper::OAuth::Helpers
7
7
  describe ".valid?" do
8
8
  it "is valid for valid uris" do
9
9
  uri = "http://app.co"
10
- URIChecker.valid?(uri).should be_true
10
+ expect(URIChecker.valid?(uri)).to be_true
11
11
  end
12
12
 
13
13
  it "is valid if include path param" do
14
14
  uri = "http://app.co/path"
15
- URIChecker.valid?(uri).should be_true
15
+ expect(URIChecker.valid?(uri)).to be_true
16
16
  end
17
17
 
18
18
  it "is valid if include query param" do
19
19
  uri = "http://app.co/?query=1"
20
- URIChecker.valid?(uri).should be_true
20
+ expect(URIChecker.valid?(uri)).to be_true
21
21
  end
22
22
 
23
23
  it "is invalid if uri includes fragment" do
24
24
  uri = "http://app.co/test#fragment"
25
- URIChecker.valid?(uri).should be_false
25
+ expect(URIChecker.valid?(uri)).to be_false
26
26
  end
27
27
 
28
28
  it "is invalid if scheme is missing" do
29
29
  uri = "app.co"
30
- URIChecker.valid?(uri).should be_false
30
+ expect(URIChecker.valid?(uri)).to be_false
31
31
  end
32
32
 
33
33
  it "is invalid if is a relative uri" do
34
34
  uri = "/abc/123"
35
- URIChecker.valid?(uri).should be_false
35
+ expect(URIChecker.valid?(uri)).to be_false
36
36
  end
37
37
 
38
38
  it "is invalid if is not a url" do
39
39
  uri = "http://"
40
- URIChecker.valid?(uri).should be_false
40
+ expect(URIChecker.valid?(uri)).to be_false
41
41
  end
42
42
  end
43
43
 
44
44
  describe ".matches?" do
45
45
  it "is true if both url matches" do
46
46
  uri = client_uri = 'http://app.co/aaa'
47
- URIChecker.matches?(uri, client_uri).should be_true
47
+ expect(URIChecker.matches?(uri, client_uri)).to be_true
48
48
  end
49
49
 
50
50
  it "ignores query parameter on comparsion" do
51
51
  uri = 'http://app.co/?query=hello'
52
52
  client_uri = 'http://app.co'
53
- URIChecker.matches?(uri, client_uri).should be_true
53
+ expect(URIChecker.matches?(uri, client_uri)).to be_true
54
54
  end
55
55
  end
56
56
 
57
57
  describe ".valid_for_authorization?" do
58
58
  it "is true if valid and matches" do
59
59
  uri = client_uri = 'http://app.co/aaa'
60
- URIChecker.valid_for_authorization?(uri, client_uri).should be_true
60
+ expect(URIChecker.valid_for_authorization?(uri, client_uri)).to be_true
61
61
  end
62
62
 
63
63
  it "is false if valid and mismatches" do
64
64
  uri = 'http://app.co/aaa'
65
65
  client_uri = 'http://app.co/bbb'
66
- URIChecker.valid_for_authorization?(uri, client_uri).should be_false
66
+ expect(URIChecker.valid_for_authorization?(uri, client_uri)).to be_false
67
67
  end
68
68
 
69
69
  it "is true if valid and included in array" do
70
70
  uri = 'http://app.co/aaa'
71
71
  client_uri = "http://example.com/bbb\nhttp://app.co/aaa"
72
- URIChecker.valid_for_authorization?(uri, client_uri).should be_true
72
+ expect(URIChecker.valid_for_authorization?(uri, client_uri)).to be_true
73
73
  end
74
74
 
75
75
  it "is false if valid and not included in array" do
76
76
  uri = 'http://app.co/aaa'
77
77
  client_uri = "http://example.com/bbb\nhttp://app.co/cc"
78
- URIChecker.valid_for_authorization?(uri, client_uri).should be_false
78
+ expect(URIChecker.valid_for_authorization?(uri, client_uri)).to be_false
79
79
  end
80
80
  end
81
81
  end
@@ -5,18 +5,23 @@ require 'doorkeeper/oauth/invalid_token_response'
5
5
 
6
6
  module Doorkeeper::OAuth
7
7
  describe InvalidTokenResponse do
8
- its(:name) { should == :invalid_token }
9
- its(:status) { should == :unauthorized }
8
+ describe '#name' do
9
+ it { expect(subject.name).to eq(:invalid_token) }
10
+ end
11
+
12
+ describe '#status' do
13
+ it { expect(subject.status).to eq(:unauthorized) }
14
+ end
10
15
 
11
16
  describe :from_access_token do
12
17
  it 'revoked' do
13
18
  response = InvalidTokenResponse.from_access_token double(:revoked? => true, :expired? => true)
14
- response.description.should include("revoked")
19
+ expect(response.description).to include("revoked")
15
20
  end
16
21
 
17
22
  it 'expired' do
18
23
  response = InvalidTokenResponse.from_access_token double(:revoked? => false, :expired? => true)
19
- response.description.should include("expired")
24
+ expect(response.description).to include("expired")
20
25
  end
21
26
  end
22
27
  end
@@ -30,18 +30,18 @@ module Doorkeeper::OAuth
30
30
  subject.authorize
31
31
  }.to_not change { Doorkeeper::AccessToken.count }
32
32
 
33
- subject.error.should == :invalid_client
33
+ expect(subject.error).to eq(:invalid_client)
34
34
  end
35
35
 
36
36
  it 'requires the owner' do
37
37
  subject.resource_owner = nil
38
38
  subject.validate
39
- subject.error.should == :invalid_resource_owner
39
+ expect(subject.error).to eq(:invalid_resource_owner)
40
40
  end
41
41
 
42
42
  it 'optionally accepts the client' do
43
43
  subject.credentials = nil
44
- subject.should be_valid
44
+ expect(subject).to be_valid
45
45
  end
46
46
 
47
47
  describe "with scopes" do
@@ -50,17 +50,17 @@ module Doorkeeper::OAuth
50
50
  end
51
51
 
52
52
  it 'validates the current scope' do
53
- server.stub :scopes => Doorkeeper::OAuth::Scopes.from_string('another')
53
+ allow(server).to receive(:scopes).and_return(Doorkeeper::OAuth::Scopes.from_string('another'))
54
54
  subject.validate
55
- subject.error.should == :invalid_scope
55
+ expect(subject.error).to eq(:invalid_scope)
56
56
  end
57
57
 
58
58
  it 'creates the token with scopes' do
59
- server.stub :scopes => Doorkeeper::OAuth::Scopes.from_string("public")
59
+ allow(server).to receive(:scopes).and_return(Doorkeeper::OAuth::Scopes.from_string("public"))
60
60
  expect {
61
61
  subject.authorize
62
62
  }.to change { Doorkeeper::AccessToken.count }.by(1)
63
- Doorkeeper::AccessToken.last.scopes.should include('public')
63
+ expect(Doorkeeper::AccessToken.last.scopes).to include('public')
64
64
  end
65
65
  end
66
66
  end
@@ -18,63 +18,63 @@ module Doorkeeper::OAuth
18
18
  end
19
19
 
20
20
  it 'is authorizable when request is valid' do
21
- subject.should be_authorizable
21
+ expect(subject).to be_authorizable
22
22
  end
23
23
 
24
24
  it 'accepts code as response type' do
25
25
  subject.response_type = 'code'
26
- subject.should be_authorizable
26
+ expect(subject).to be_authorizable
27
27
  end
28
28
 
29
29
  it 'accepts token as response type' do
30
30
  subject.response_type = 'token'
31
- subject.should be_authorizable
31
+ expect(subject).to be_authorizable
32
32
  end
33
33
 
34
34
  it 'accepts valid scopes' do
35
35
  subject.scope = 'public'
36
- subject.should be_authorizable
36
+ expect(subject).to be_authorizable
37
37
  end
38
38
 
39
39
  it 'uses default scopes when none is required' do
40
- server.stub :default_scopes => Scopes.from_string('default')
40
+ allow(server).to receive(:default_scopes).and_return(Scopes.from_string('default'))
41
41
  subject.scope = nil
42
- subject.scope.should == 'default'
43
- subject.scopes.should == Scopes.from_string('default')
42
+ expect(subject.scope).to eq('default')
43
+ expect(subject.scopes).to eq(Scopes.from_string('default'))
44
44
  end
45
45
 
46
46
  it 'accepts test uri' do
47
47
  subject.redirect_uri = 'urn:ietf:wg:oauth:2.0:oob'
48
- subject.should be_authorizable
48
+ expect(subject).to be_authorizable
49
49
  end
50
50
 
51
51
  it "matches the redirect uri against client's one" do
52
52
  subject.redirect_uri = 'http://nothesame.com'
53
- subject.should_not be_authorizable
53
+ expect(subject).not_to be_authorizable
54
54
  end
55
55
 
56
56
  it 'stores the state' do
57
- subject.state.should == 'save-this'
57
+ expect(subject.state).to eq('save-this')
58
58
  end
59
59
 
60
60
  it 'rejects if response type is not allowed' do
61
61
  subject.response_type = 'whops'
62
- subject.should_not be_authorizable
62
+ expect(subject).not_to be_authorizable
63
63
  end
64
64
 
65
65
  it 'requires an existing client' do
66
66
  subject.client = nil
67
- subject.should_not be_authorizable
67
+ expect(subject).not_to be_authorizable
68
68
  end
69
69
 
70
70
  it 'requires a redirect uri' do
71
71
  subject.redirect_uri = nil
72
- subject.should_not be_authorizable
72
+ expect(subject).not_to be_authorizable
73
73
  end
74
74
 
75
75
  it 'rejects non-valid scopes' do
76
76
  subject.scope = 'invalid'
77
- subject.should_not be_authorizable
77
+ expect(subject).not_to be_authorizable
78
78
  end
79
79
  end
80
80
  end
@@ -26,32 +26,32 @@ module Doorkeeper::OAuth
26
26
  it 'requires the refresh token' do
27
27
  subject.refresh_token = nil
28
28
  subject.validate
29
- subject.error.should == :invalid_request
29
+ expect(subject.error).to eq(:invalid_request)
30
30
  end
31
31
 
32
32
  it 'requires credentials to be valid if provided' do
33
33
  subject.client = nil
34
34
  subject.validate
35
- subject.error.should == :invalid_client
35
+ expect(subject.error).to eq(:invalid_client)
36
36
  end
37
37
 
38
38
  it "requires the token's client and current client to match" do
39
39
  subject.client = FactoryGirl.create(:application)
40
40
  subject.validate
41
- subject.error.should == :invalid_grant
41
+ expect(subject.error).to eq(:invalid_grant)
42
42
  end
43
43
 
44
44
  it 'rejects revoked tokens' do
45
45
  refresh_token.revoke
46
46
  subject.validate
47
- subject.error.should == :invalid_request
47
+ expect(subject.error).to eq(:invalid_request)
48
48
  end
49
49
 
50
50
  it 'accepts expired tokens' do
51
51
  refresh_token.expires_in = -1
52
52
  refresh_token.save
53
53
  subject.validate
54
- subject.should be_valid
54
+ expect(subject).to be_valid
55
55
  end
56
56
 
57
57
  context 'clientless access tokens' do
@@ -77,20 +77,20 @@ module Doorkeeper::OAuth
77
77
 
78
78
  it 'transfers scopes from the old token to the new token' do
79
79
  subject.authorize
80
- Doorkeeper::AccessToken.last.scopes.should == [:public, :write]
80
+ expect(Doorkeeper::AccessToken.last.scopes).to eq([:public, :write])
81
81
  end
82
82
 
83
83
  it 'reduces scopes to the provided scopes' do
84
84
  parameters[:scopes] = 'public'
85
85
  subject.authorize
86
- Doorkeeper::AccessToken.last.scopes.should == [:public]
86
+ expect(Doorkeeper::AccessToken.last.scopes).to eq([:public])
87
87
  end
88
88
 
89
89
  it 'validates that scopes are included in the original access token' do
90
90
  parameters[:scopes] = 'public update'
91
91
 
92
92
  subject.validate
93
- subject.error.should == :invalid_scope
93
+ expect(subject.error).to eq(:invalid_scope)
94
94
  end
95
95
  end
96
96
 
@@ -8,18 +8,18 @@ module Doorkeeper::OAuth
8
8
  describe :add do
9
9
  it 'allows you to add scopes with symbols' do
10
10
  subject.add :public
11
- subject.all.should == ['public']
11
+ expect(subject.all).to eq(['public'])
12
12
  end
13
13
 
14
14
  it 'allows you to add scopes with strings' do
15
15
  subject.add "public"
16
- subject.all.should == ['public']
16
+ expect(subject.all).to eq(['public'])
17
17
  end
18
18
 
19
19
  it 'do not add already included scopes' do
20
20
  subject.add :public
21
21
  subject.add :public
22
- subject.all.should == ['public']
22
+ expect(subject.all).to eq(['public'])
23
23
  end
24
24
  end
25
25
 
@@ -29,16 +29,16 @@ module Doorkeeper::OAuth
29
29
  end
30
30
 
31
31
  it 'returns true if scope with given name is present' do
32
- subject.exists?("public").should be_true
32
+ expect(subject.exists?("public")).to be_true
33
33
  end
34
34
 
35
35
  it 'returns false if scope with given name does not exist' do
36
- subject.exists?("other").should be_false
36
+ expect(subject.exists?("other")).to be_false
37
37
  end
38
38
 
39
39
  it 'handles symbols' do
40
- subject.exists?(:public).should be_true
41
- subject.exists?(:other).should be_false
40
+ expect(subject.exists?(:public)).to be_true
41
+ expect(subject.exists?(:other)).to be_false
42
42
  end
43
43
  end
44
44
 
@@ -48,19 +48,27 @@ module Doorkeeper::OAuth
48
48
  subject { Scopes.from_string(string) }
49
49
 
50
50
  it { should be_a(Scopes) }
51
- its(:all) { should == ['public', 'write'] }
51
+
52
+ describe '#all' do
53
+ it 'should be an array of the expected scopes' do
54
+ scopes_array = subject.all
55
+ expect(scopes_array.size).to eq(2)
56
+ expect(scopes_array).to include('public')
57
+ expect(scopes_array).to include('write')
58
+ end
59
+ end
52
60
  end
53
61
 
54
62
  describe :+ do
55
63
  it "can add to another scope object" do
56
64
  scopes = Scopes.from_string("public") + Scopes.from_string("admin")
57
- scopes.all.should == ['public', 'admin']
65
+ expect(scopes.all).to eq(['public', 'admin'])
58
66
  end
59
67
 
60
68
  it "does not change the existing object" do
61
69
  origin = Scopes.from_string("public")
62
70
  new_scope = origin + Scopes.from_string("admin")
63
- origin.to_s.should == "public"
71
+ expect(origin.to_s).to eq("public")
64
72
  end
65
73
 
66
74
  it "raises an error if cannot handle addition" do
@@ -72,15 +80,15 @@ module Doorkeeper::OAuth
72
80
 
73
81
  describe :== do
74
82
  it 'is equal to another set of scopes' do
75
- Scopes.from_string("public").should == Scopes.from_string("public")
83
+ expect(Scopes.from_string("public")).to eq(Scopes.from_string("public"))
76
84
  end
77
85
 
78
86
  it 'is equal to another set of scopes with no particular order' do
79
- Scopes.from_string("public write").should == Scopes.from_string("write public")
87
+ expect(Scopes.from_string("public write")).to eq(Scopes.from_string("write public"))
80
88
  end
81
89
 
82
90
  it 'differs from another set of scopes when scopes are not the same' do
83
- Scopes.from_string("public write").should_not == Scopes.from_string("write")
91
+ expect(Scopes.from_string("public write")).not_to eq(Scopes.from_string("write"))
84
92
  end
85
93
  end
86
94
 
@@ -88,27 +96,27 @@ module Doorkeeper::OAuth
88
96
  subject { Scopes.from_string("public admin") }
89
97
 
90
98
  it "returns true when at least one scope is included" do
91
- subject.has_scopes?(Scopes.from_string("public")).should be_true
99
+ expect(subject.has_scopes?(Scopes.from_string("public"))).to be_true
92
100
  end
93
101
 
94
102
  it "returns true when all scopes are included" do
95
- subject.has_scopes?(Scopes.from_string("public admin")).should be_true
103
+ expect(subject.has_scopes?(Scopes.from_string("public admin"))).to be_true
96
104
  end
97
105
 
98
106
  it "is true if all scopes are included in any order" do
99
- subject.has_scopes?(Scopes.from_string("admin public")).should be_true
107
+ expect(subject.has_scopes?(Scopes.from_string("admin public"))).to be_true
100
108
  end
101
109
 
102
110
  it "is false if no scopes are included" do
103
- subject.has_scopes?(Scopes.from_string("notexistent")).should be_false
111
+ expect(subject.has_scopes?(Scopes.from_string("notexistent"))).to be_false
104
112
  end
105
113
 
106
114
  it "returns false when any scope is not included" do
107
- subject.has_scopes?(Scopes.from_string("public nope")).should be_false
115
+ expect(subject.has_scopes?(Scopes.from_string("public nope"))).to be_false
108
116
  end
109
117
 
110
118
  it "is false if no scopes are included even for existing ones" do
111
- subject.has_scopes?(Scopes.from_string("public admin notexistent")).should be_false
119
+ expect(subject.has_scopes?(Scopes.from_string("public admin notexistent"))).to be_false
112
120
  end
113
121
  end
114
122
  end