Skip to content

Commit

Permalink
mongoid2 failures not allowed in Travis anymore
Browse files Browse the repository at this point in the history
  • Loading branch information
tute committed Feb 4, 2014
1 parent 7e7576d commit 870b2c5
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
3 changes: 0 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,3 @@ env:
- orm=mongo_mapper
services:
- mongodb
matrix:
allow_failures:
- env: orm=mongoid2
2 changes: 1 addition & 1 deletion spec/requests/flows/authorization_code_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@

should_have_json 'access_token', Doorkeeper::AccessToken.first.token
should_have_json 'token_type', "bearer"
should_have_json 'expires_in', Doorkeeper::AccessToken.first.expires_in
should_have_json_within 'expires_in', Doorkeeper::AccessToken.first.expires_in, 1
end

context 'with scopes' do
Expand Down
2 changes: 1 addition & 1 deletion spec/requests/flows/client_credentials_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
post '/oauth/token', params, headers

should_have_json 'access_token', Doorkeeper::AccessToken.first.token
should_have_json 'expires_in', Doorkeeper.configuration.access_token_expires_in
should_have_json_within 'expires_in', Doorkeeper.configuration.access_token_expires_in, 1
should_not_have_json 'scope'
should_not_have_json 'refresh_token'

Expand Down
4 changes: 4 additions & 0 deletions spec/support/helpers/request_spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ def should_have_json(key, value)
expect(JSON.parse(response.body).fetch(key)).to eq(value)
end

def should_have_json_within(key, value, range)
expect(JSON.parse(response.body).fetch(key)).to be_within(range).of(value)
end

def should_not_have_json(key)
expect(JSON.parse(response.body)).not_to have_key(key)
end
Expand Down

0 comments on commit 870b2c5

Please sign in to comment.