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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +2 -1
- data/lib/doorkeeper/version.rb +1 -1
- data/spec/controllers/applications_controller_spec.rb +4 -4
- data/spec/controllers/authorizations_controller_spec.rb +9 -9
- data/spec/controllers/protected_resources_controller_spec.rb +10 -10
- data/spec/controllers/token_info_controller_spec.rb +4 -4
- data/spec/controllers/tokens_controller_spec.rb +4 -4
- data/spec/lib/config_spec.rb +21 -21
- data/spec/lib/models/expirable_spec.rb +13 -13
- data/spec/lib/models/revocable_spec.rb +5 -5
- data/spec/lib/models/scopes_spec.rb +3 -3
- data/spec/lib/oauth/authorization/uri_builder_spec.rb +5 -5
- data/spec/lib/oauth/authorization_code_request_spec.rb +7 -7
- data/spec/lib/oauth/client/credentials_spec.rb +8 -8
- data/spec/lib/oauth/client/methods_spec.rb +8 -8
- data/spec/lib/oauth/client_credentials/creator_spec.rb +2 -2
- data/spec/lib/oauth/client_credentials/issuer_spec.rb +10 -9
- data/spec/lib/oauth/client_credentials/validation_spec.rb +6 -6
- data/spec/lib/oauth/client_credentials_request_spec.rb +7 -7
- data/spec/lib/oauth/client_spec.rb +8 -8
- data/spec/lib/oauth/code_request_spec.rb +4 -4
- data/spec/lib/oauth/error_response_spec.rb +22 -15
- data/spec/lib/oauth/error_spec.rb +1 -1
- data/spec/lib/oauth/helpers/scope_checker_spec.rb +13 -13
- data/spec/lib/oauth/helpers/unique_token_spec.rb +2 -2
- data/spec/lib/oauth/helpers/uri_checker_spec.rb +13 -13
- data/spec/lib/oauth/invalid_token_response_spec.rb +9 -4
- data/spec/lib/oauth/password_access_token_request_spec.rb +7 -7
- data/spec/lib/oauth/pre_authorization_spec.rb +14 -14
- data/spec/lib/oauth/refresh_token_request_spec.rb +8 -8
- data/spec/lib/oauth/scopes_spec.rb +27 -19
- data/spec/lib/oauth/token_request_spec.rb +4 -4
- data/spec/lib/oauth/token_response_spec.rb +11 -11
- data/spec/lib/oauth/token_spec.rb +9 -9
- data/spec/lib/server_spec.rb +1 -1
- data/spec/models/doorkeeper/access_token_spec.rb +15 -15
- data/spec/models/doorkeeper/application_spec.rb +21 -21
- data/spec/requests/flows/authorization_code_spec.rb +1 -1
- data/spec/requests/flows/client_credentials_spec.rb +1 -1
- data/spec/requests/flows/refresh_token_spec.rb +6 -6
- data/spec/requests/protected_resources/private_api_spec.rb +3 -3
- data/spec/routing/custom_controller_routes_spec.rb +16 -16
- data/spec/routing/default_routes_spec.rb +7 -7
- data/spec/routing/scoped_routes_spec.rb +7 -7
- data/spec/support/helpers/authorization_request_helper.rb +3 -3
- data/spec/support/helpers/model_helper.rb +6 -6
- data/spec/support/helpers/request_spec_helper.rb +9 -9
- data/spec/support/shared/controllers_shared_context.rb +6 -6
- data/spec/support/shared/models_shared_examples.rb +6 -6
- data/spec/validators/redirect_uri_validator_spec.rb +12 -12
- metadata +4 -4
@@ -22,7 +22,7 @@ feature "Refresh Token Flow" do
|
|
22
22
|
should_have_json 'access_token', token.token
|
23
23
|
should_have_json 'refresh_token', token.refresh_token
|
24
24
|
|
25
|
-
@authorization.reload.
|
25
|
+
expect(@authorization.reload).to be_revoked
|
26
26
|
|
27
27
|
post refresh_token_endpoint_url(:client => @client, :refresh_token => token.refresh_token)
|
28
28
|
|
@@ -30,8 +30,8 @@ feature "Refresh Token Flow" do
|
|
30
30
|
should_have_json 'access_token', new_token.token
|
31
31
|
should_have_json 'refresh_token', new_token.refresh_token
|
32
32
|
|
33
|
-
token.token.
|
34
|
-
token.refresh_token.
|
33
|
+
expect(token.token).not_to eq(new_token.token)
|
34
|
+
expect(token.refresh_token).not_to eq(new_token.refresh_token)
|
35
35
|
end
|
36
36
|
end
|
37
37
|
|
@@ -43,14 +43,14 @@ feature "Refresh Token Flow" do
|
|
43
43
|
scenario "client request a token with refresh token" do
|
44
44
|
post refresh_token_endpoint_url(:client => @client, :refresh_token => @token.refresh_token)
|
45
45
|
should_have_json 'refresh_token', Doorkeeper::AccessToken.last.refresh_token
|
46
|
-
@token.reload.
|
46
|
+
expect(@token.reload).to be_revoked
|
47
47
|
end
|
48
48
|
|
49
49
|
scenario "client request a token with expired access token" do
|
50
50
|
@token.update_column :expires_in, -100
|
51
51
|
post refresh_token_endpoint_url(:client => @client, :refresh_token => @token.refresh_token)
|
52
52
|
should_have_json 'refresh_token', Doorkeeper::AccessToken.last.refresh_token
|
53
|
-
@token.reload.
|
53
|
+
expect(@token.reload).to be_revoked
|
54
54
|
end
|
55
55
|
|
56
56
|
# TODO: verify proper error code for this (previously was invalid_grant)
|
@@ -82,7 +82,7 @@ feature "Refresh Token Flow" do
|
|
82
82
|
post password_token_endpoint_url(:client => @client, :resource_owner => @resource_owner)
|
83
83
|
post refresh_token_endpoint_url(:client => @client, :refresh_token => @token.refresh_token)
|
84
84
|
should_have_json 'refresh_token', Doorkeeper::AccessToken.last.refresh_token
|
85
|
-
@token.reload.
|
85
|
+
expect(@token.reload).to be_revoked
|
86
86
|
end
|
87
87
|
end
|
88
88
|
end
|
@@ -10,7 +10,7 @@ feature 'Private API' do
|
|
10
10
|
scenario 'client requests protected resource with valid token' do
|
11
11
|
with_access_token_header @token.token
|
12
12
|
visit '/full_protected_resources'
|
13
|
-
page.body.
|
13
|
+
expect(page.body).to have_content("index")
|
14
14
|
end
|
15
15
|
|
16
16
|
scenario 'client requests protected resource with disabled header authentication' do
|
@@ -37,7 +37,7 @@ feature 'Private API' do
|
|
37
37
|
@token.update_column :expires_in, nil # never expires
|
38
38
|
with_access_token_header @token.token
|
39
39
|
visit '/full_protected_resources'
|
40
|
-
page.body.
|
40
|
+
expect(page.body).to have_content("index")
|
41
41
|
end
|
42
42
|
|
43
43
|
scenario 'access token with no scopes' do
|
@@ -53,6 +53,6 @@ feature 'Private API' do
|
|
53
53
|
@token.update_column :scopes, 'admin'
|
54
54
|
with_access_token_header @token.token
|
55
55
|
visit '/full_protected_resources/1.json'
|
56
|
-
page.body.
|
56
|
+
expect(page.body).to have_content("show")
|
57
57
|
end
|
58
58
|
end
|
@@ -2,67 +2,67 @@ require 'spec_helper_integration'
|
|
2
2
|
|
3
3
|
describe 'Custom controller for routes' do
|
4
4
|
it 'GET /space/scope/authorize routes to custom authorizations controller' do
|
5
|
-
get('/inner_space/scope/authorize').
|
5
|
+
expect(get('/inner_space/scope/authorize')).to route_to('custom_authorizations#new')
|
6
6
|
end
|
7
7
|
|
8
8
|
it 'POST /space/scope/authorize routes to custom authorizations controller' do
|
9
|
-
post('/inner_space/scope/authorize').
|
9
|
+
expect(post('/inner_space/scope/authorize')).to route_to('custom_authorizations#create')
|
10
10
|
end
|
11
11
|
|
12
12
|
it 'DELETE /space/scope/authorize routes to custom authorizations controller' do
|
13
|
-
delete('/inner_space/scope/authorize').
|
13
|
+
expect(delete('/inner_space/scope/authorize')).to route_to('custom_authorizations#destroy')
|
14
14
|
end
|
15
15
|
|
16
16
|
it 'POST /space/scope/token routes to tokens controller' do
|
17
|
-
post('/inner_space/scope/token').
|
17
|
+
expect(post('/inner_space/scope/token')).to route_to('custom_authorizations#create')
|
18
18
|
end
|
19
19
|
|
20
20
|
it 'GET /space/scope/applications routes to applications controller' do
|
21
|
-
get('/inner_space/scope/applications').
|
21
|
+
expect(get('/inner_space/scope/applications')).to route_to('custom_authorizations#index')
|
22
22
|
end
|
23
23
|
|
24
24
|
it 'GET /space/scope/token/info routes to the token_info controller' do
|
25
|
-
get('/inner_space/scope/token/info').
|
25
|
+
expect(get('/inner_space/scope/token/info')).to route_to('custom_authorizations#show')
|
26
26
|
end
|
27
27
|
|
28
28
|
it 'GET /space/oauth/authorize routes to custom authorizations controller' do
|
29
|
-
get('/space/oauth/authorize').
|
29
|
+
expect(get('/space/oauth/authorize')).to route_to('custom_authorizations#new')
|
30
30
|
end
|
31
31
|
|
32
32
|
it 'POST /space/oauth/authorize routes to custom authorizations controller' do
|
33
|
-
post('/space/oauth/authorize').
|
33
|
+
expect(post('/space/oauth/authorize')).to route_to('custom_authorizations#create')
|
34
34
|
end
|
35
35
|
|
36
36
|
it 'DELETE /space/oauth/authorize routes to custom authorizations controller' do
|
37
|
-
delete('/space/oauth/authorize').
|
37
|
+
expect(delete('/space/oauth/authorize')).to route_to('custom_authorizations#destroy')
|
38
38
|
end
|
39
39
|
|
40
40
|
it 'POST /space/oauth/token routes to tokens controller' do
|
41
|
-
post('/space/oauth/token').
|
41
|
+
expect(post('/space/oauth/token')).to route_to('custom_authorizations#create')
|
42
42
|
end
|
43
43
|
|
44
44
|
it 'GET /space/oauth/applications routes to applications controller' do
|
45
|
-
get('/space/oauth/applications').
|
45
|
+
expect(get('/space/oauth/applications')).to route_to('custom_authorizations#index')
|
46
46
|
end
|
47
47
|
|
48
48
|
it 'GET /space/oauth/token/info routes to the token_info controller' do
|
49
|
-
get('/space/oauth/token/info').
|
49
|
+
expect(get('/space/oauth/token/info')).to route_to('custom_authorizations#show')
|
50
50
|
end
|
51
51
|
|
52
52
|
it 'POST /outer_space/oauth/token is not be routable' do
|
53
|
-
post('/outer_space/oauth/token').
|
53
|
+
expect(post('/outer_space/oauth/token')).not_to be_routable
|
54
54
|
end
|
55
55
|
|
56
56
|
it 'GET /outer_space/oauth/authorize routes to custom authorizations controller' do
|
57
|
-
get('/outer_space/oauth/authorize').
|
57
|
+
expect(get('/outer_space/oauth/authorize')).to be_routable
|
58
58
|
end
|
59
59
|
|
60
60
|
it 'GET /outer_space/oauth/applications is not routable' do
|
61
|
-
get('/outer_space/oauth/applications').
|
61
|
+
expect(get('/outer_space/oauth/applications')).not_to be_routable
|
62
62
|
end
|
63
63
|
|
64
64
|
it 'GET /outer_space/oauth/token_info is not routable' do
|
65
|
-
get('/outer_space/oauth/token/info').
|
65
|
+
expect(get('/outer_space/oauth/token/info')).not_to be_routable
|
66
66
|
end
|
67
67
|
|
68
68
|
end
|
@@ -2,31 +2,31 @@ require 'spec_helper_integration'
|
|
2
2
|
|
3
3
|
describe 'Default routes' do
|
4
4
|
it 'GET /oauth/authorize routes to authorizations controller' do
|
5
|
-
get('/oauth/authorize').
|
5
|
+
expect(get('/oauth/authorize')).to route_to('doorkeeper/authorizations#new')
|
6
6
|
end
|
7
7
|
|
8
8
|
it 'POST /oauth/authorize routes to authorizations controller' do
|
9
|
-
post('/oauth/authorize').
|
9
|
+
expect(post('/oauth/authorize')).to route_to('doorkeeper/authorizations#create')
|
10
10
|
end
|
11
11
|
|
12
12
|
it 'DELETE /oauth/authorize routes to authorizations controller' do
|
13
|
-
delete('/oauth/authorize').
|
13
|
+
expect(delete('/oauth/authorize')).to route_to('doorkeeper/authorizations#destroy')
|
14
14
|
end
|
15
15
|
|
16
16
|
it 'POST /oauth/token routes to tokens controller' do
|
17
|
-
post('/oauth/token').
|
17
|
+
expect(post('/oauth/token')).to route_to('doorkeeper/tokens#create')
|
18
18
|
end
|
19
19
|
|
20
20
|
it 'GET /oauth/applications routes to applications controller' do
|
21
|
-
get('/oauth/applications').
|
21
|
+
expect(get('/oauth/applications')).to route_to('doorkeeper/applications#index')
|
22
22
|
end
|
23
23
|
|
24
24
|
it 'GET /oauth/authorized_applications routes to authorized applications controller' do
|
25
|
-
get('/oauth/authorized_applications').
|
25
|
+
expect(get('/oauth/authorized_applications')).to route_to('doorkeeper/authorized_applications#index')
|
26
26
|
end
|
27
27
|
|
28
28
|
it 'GET /oauth/token/info route to authorzed tokeninfo controller' do
|
29
|
-
get('/oauth/token/info').
|
29
|
+
expect(get('/oauth/token/info')).to route_to('doorkeeper/token_info#show')
|
30
30
|
end
|
31
31
|
|
32
32
|
end
|
@@ -2,31 +2,31 @@ require 'spec_helper_integration'
|
|
2
2
|
|
3
3
|
describe 'Scoped routes' do
|
4
4
|
it 'GET /scope/authorize routes to authorizations controller' do
|
5
|
-
get('/scope/authorize').
|
5
|
+
expect(get('/scope/authorize')).to route_to('doorkeeper/authorizations#new')
|
6
6
|
end
|
7
7
|
|
8
8
|
it 'POST /scope/authorize routes to authorizations controller' do
|
9
|
-
post('/scope/authorize').
|
9
|
+
expect(post('/scope/authorize')).to route_to('doorkeeper/authorizations#create')
|
10
10
|
end
|
11
11
|
|
12
12
|
it 'DELETE /scope/authorize routes to authorizations controller' do
|
13
|
-
delete('/scope/authorize').
|
13
|
+
expect(delete('/scope/authorize')).to route_to('doorkeeper/authorizations#destroy')
|
14
14
|
end
|
15
15
|
|
16
16
|
it 'POST /scope/token routes to tokens controller' do
|
17
|
-
post('/scope/token').
|
17
|
+
expect(post('/scope/token')).to route_to('doorkeeper/tokens#create')
|
18
18
|
end
|
19
19
|
|
20
20
|
it 'GET /scope/applications routes to applications controller' do
|
21
|
-
get('/scope/applications').
|
21
|
+
expect(get('/scope/applications')).to route_to('doorkeeper/applications#index')
|
22
22
|
end
|
23
23
|
|
24
24
|
it 'GET /scope/authorized_applications routes to authorized applications controller' do
|
25
|
-
get('/scope/authorized_applications').
|
25
|
+
expect(get('/scope/authorized_applications')).to route_to('doorkeeper/authorized_applications#index')
|
26
26
|
end
|
27
27
|
|
28
28
|
it 'GET /scope/token/info route to authorzed tokeninfo controller' do
|
29
|
-
get('/scope/token/info').
|
29
|
+
expect(get('/scope/token/info')).to route_to('doorkeeper/token_info#show')
|
30
30
|
end
|
31
31
|
|
32
32
|
end
|
@@ -17,15 +17,15 @@ module AuthorizationRequestHelper
|
|
17
17
|
end
|
18
18
|
|
19
19
|
def client_should_be_authorized(client)
|
20
|
-
client.
|
20
|
+
expect(client).to have(1).access_grants
|
21
21
|
end
|
22
22
|
|
23
23
|
def client_should_not_be_authorized(client)
|
24
|
-
client.
|
24
|
+
expect(client.size).to eq(0)
|
25
25
|
end
|
26
26
|
|
27
27
|
def i_should_be_on_client_callback(client)
|
28
|
-
client.redirect_uri.
|
28
|
+
expect(client.redirect_uri).to eq("#{current_uri.scheme}://#{current_uri.host}#{current_uri.path}")
|
29
29
|
end
|
30
30
|
end
|
31
31
|
|
@@ -13,32 +13,32 @@ module ModelHelper
|
|
13
13
|
|
14
14
|
def access_grant_should_exist_for(client, resource_owner)
|
15
15
|
grant = Doorkeeper::AccessGrant.first
|
16
|
-
grant.application.
|
16
|
+
expect(grant.application).to eq(client)
|
17
17
|
grant.resource_owner_id == resource_owner.id
|
18
18
|
end
|
19
19
|
|
20
20
|
def access_token_should_exist_for(client, resource_owner)
|
21
21
|
grant = Doorkeeper::AccessToken.first
|
22
|
-
grant.application.
|
22
|
+
expect(grant.application).to eq(client)
|
23
23
|
grant.resource_owner_id == resource_owner.id
|
24
24
|
end
|
25
25
|
|
26
26
|
def access_grant_should_not_exist
|
27
|
-
Doorkeeper::AccessGrant.all.
|
27
|
+
expect(Doorkeeper::AccessGrant.all).to be_empty
|
28
28
|
end
|
29
29
|
|
30
30
|
def access_token_should_not_exist
|
31
|
-
Doorkeeper::AccessToken.all.
|
31
|
+
expect(Doorkeeper::AccessToken.all).to be_empty
|
32
32
|
end
|
33
33
|
|
34
34
|
def access_grant_should_have_scopes(*args)
|
35
35
|
grant = Doorkeeper::AccessGrant.first
|
36
|
-
grant.scopes.
|
36
|
+
expect(grant.scopes).to eq(Doorkeeper::OAuth::Scopes.from_array(args))
|
37
37
|
end
|
38
38
|
|
39
39
|
def access_token_should_have_scopes(*args)
|
40
40
|
grant = Doorkeeper::AccessToken.first
|
41
|
-
grant.scopes.
|
41
|
+
expect(grant.scopes).to eq(Doorkeeper::OAuth::Scopes.from_array(args))
|
42
42
|
end
|
43
43
|
end
|
44
44
|
|
@@ -1,22 +1,22 @@
|
|
1
1
|
module RequestSpecHelper
|
2
2
|
def i_should_see(content)
|
3
|
-
page.
|
3
|
+
expect(page).to have_content(content)
|
4
4
|
end
|
5
5
|
|
6
6
|
def i_should_not_see(content)
|
7
|
-
page.
|
7
|
+
expect(page).to have_no_content(content)
|
8
8
|
end
|
9
9
|
|
10
10
|
def i_should_be_on(path)
|
11
|
-
current_path.
|
11
|
+
expect(current_path).to eq(path)
|
12
12
|
end
|
13
13
|
|
14
14
|
def url_should_have_param(param, value)
|
15
|
-
current_params[param].
|
15
|
+
expect(current_params[param]).to eq(value)
|
16
16
|
end
|
17
17
|
|
18
18
|
def url_should_not_have_param(param)
|
19
|
-
current_params.
|
19
|
+
expect(current_params).not_to have_key(param)
|
20
20
|
end
|
21
21
|
|
22
22
|
def current_params
|
@@ -28,7 +28,7 @@ module RequestSpecHelper
|
|
28
28
|
end
|
29
29
|
|
30
30
|
def should_have_header(header, value)
|
31
|
-
headers[header].
|
31
|
+
expect(headers[header]).to eq(value)
|
32
32
|
end
|
33
33
|
|
34
34
|
def with_access_token_header(token)
|
@@ -44,11 +44,11 @@ module RequestSpecHelper
|
|
44
44
|
end
|
45
45
|
|
46
46
|
def should_have_json(key, value)
|
47
|
-
JSON.parse(response.body).fetch(key).
|
47
|
+
expect(JSON.parse(response.body).fetch(key)).to eq(value)
|
48
48
|
end
|
49
49
|
|
50
50
|
def should_not_have_json(key)
|
51
|
-
JSON.parse(response.body).
|
51
|
+
expect(JSON.parse(response.body)).not_to have_key(key)
|
52
52
|
end
|
53
53
|
|
54
54
|
def sign_in
|
@@ -65,7 +65,7 @@ module RequestSpecHelper
|
|
65
65
|
end
|
66
66
|
|
67
67
|
def response_status_should_be(status)
|
68
|
-
page.driver.response.status.to_i.
|
68
|
+
expect(page.driver.response.status.to_i).to eq(status)
|
69
69
|
end
|
70
70
|
end
|
71
71
|
|
@@ -8,7 +8,7 @@ shared_context "valid token", :token => :valid do
|
|
8
8
|
end
|
9
9
|
|
10
10
|
before :each do
|
11
|
-
Doorkeeper::AccessToken.
|
11
|
+
allow(Doorkeeper::AccessToken).to receive(:authenticate).with(token_string).and_return(token)
|
12
12
|
end
|
13
13
|
end
|
14
14
|
|
@@ -22,20 +22,20 @@ shared_context "invalid token", :token => :invalid do
|
|
22
22
|
end
|
23
23
|
|
24
24
|
before :each do
|
25
|
-
Doorkeeper::AccessToken.
|
25
|
+
allow(Doorkeeper::AccessToken).to receive(:authenticate).with(token_string).and_return(token)
|
26
26
|
end
|
27
27
|
end
|
28
28
|
|
29
29
|
shared_context "authenticated resource owner" do
|
30
30
|
before do
|
31
31
|
user = double(:resource, :id => 1)
|
32
|
-
Doorkeeper.configuration.
|
32
|
+
allow(Doorkeeper.configuration).to receive(:authenticate_resource_owner) { proc do user end }
|
33
33
|
end
|
34
34
|
end
|
35
35
|
|
36
36
|
shared_context "not authenticated resource owner" do
|
37
37
|
before do
|
38
|
-
Doorkeeper.configuration.
|
38
|
+
allow(Doorkeeper.configuration).to receive(:authenticate_resource_owner) { proc do redirect_to '/' end }
|
39
39
|
end
|
40
40
|
end
|
41
41
|
|
@@ -45,7 +45,7 @@ shared_context "valid authorization request" do
|
|
45
45
|
end
|
46
46
|
|
47
47
|
before do
|
48
|
-
controller.
|
48
|
+
allow(controller).to receive(:authorization) { authorization }
|
49
49
|
end
|
50
50
|
end
|
51
51
|
|
@@ -55,6 +55,6 @@ shared_context "invalid authorization request" do
|
|
55
55
|
end
|
56
56
|
|
57
57
|
before do
|
58
|
-
controller.
|
58
|
+
allow(controller).to receive(:authorization) { authorization }
|
59
59
|
end
|
60
60
|
end
|
@@ -1,12 +1,12 @@
|
|
1
1
|
shared_examples "an accessible token" do
|
2
2
|
describe :accessible? do
|
3
3
|
it "is accessible if token is not expired" do
|
4
|
-
subject.
|
4
|
+
allow(subject).to receive(:expired?).and_return(false)
|
5
5
|
should be_accessible
|
6
6
|
end
|
7
7
|
|
8
8
|
it "is not accessible if token is expired" do
|
9
|
-
subject.
|
9
|
+
allow(subject).to receive(:expired?).and_return(true)
|
10
10
|
should_not be_accessible
|
11
11
|
end
|
12
12
|
end
|
@@ -17,12 +17,12 @@ shared_examples "a revocable token" do
|
|
17
17
|
before { subject.save! }
|
18
18
|
|
19
19
|
it "is accessible if token is not revoked" do
|
20
|
-
subject.
|
20
|
+
expect(subject).to be_accessible
|
21
21
|
end
|
22
22
|
|
23
23
|
it "is not accessible if token is revoked" do
|
24
24
|
subject.revoke
|
25
|
-
subject.
|
25
|
+
expect(subject).not_to be_accessible
|
26
26
|
end
|
27
27
|
end
|
28
28
|
end
|
@@ -33,7 +33,7 @@ shared_examples "an unique token" do
|
|
33
33
|
tokens = []
|
34
34
|
3.times do
|
35
35
|
token = FactoryGirl.create(factory_name).token
|
36
|
-
tokens.
|
36
|
+
expect(tokens).not_to include(token)
|
37
37
|
end
|
38
38
|
end
|
39
39
|
|
@@ -45,7 +45,7 @@ shared_examples "an unique token" do
|
|
45
45
|
token1 = FactoryGirl.create factory_name
|
46
46
|
token2 = FactoryGirl.create factory_name
|
47
47
|
token2.token = token1.token
|
48
|
-
token2.
|
48
|
+
expect(token2).not_to be_valid
|
49
49
|
end
|
50
50
|
|
51
51
|
it 'expects database to throw an error when tokens are the same' do
|