Skip to content

Commit

Permalink
Merge pull request #771 from rafaelsales/fix-typo-validation-error
Browse files Browse the repository at this point in the history
Fix validation error messages
  • Loading branch information
tute committed Jan 1, 2016
2 parents 33a4ef4 + 0c8673d commit 61eb6aa
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/doorkeeper/oauth/authorization_code_request.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class AuthorizationCodeRequest
validate :attributes, error: :invalid_request
validate :client, error: :invalid_client
validate :grant, error: :invalid_grant
validate :redirect_uri, error: :invalid_grant
validate :redirect_uri, error: :invalid_redirect_uri

attr_accessor :server, :grant, :client, :redirect_uri, :access_token

Expand Down
2 changes: 1 addition & 1 deletion lib/doorkeeper/oauth/password_access_token_request.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class PasswordAccessTokenRequest
include OAuth::Helpers

validate :client, error: :invalid_client
validate :resource_owner, error: :invalid_grant
validate :resource_owner, error: :invalid_resource_owner
validate :scopes, error: :invalid_scope

attr_accessor :server, :resource_owner, :credentials, :access_token
Expand Down
2 changes: 1 addition & 1 deletion spec/lib/oauth/authorization_code_request_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ module Doorkeeper::OAuth
it "matches the redirect_uri with grant's one" do
subject.redirect_uri = 'http://other.com'
subject.validate
expect(subject.error).to eq(:invalid_grant)
expect(subject.error).to eq(:invalid_redirect_uri)
end

it "matches the client with grant's one" do
Expand Down
2 changes: 1 addition & 1 deletion spec/lib/oauth/password_access_token_request_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ module Doorkeeper::OAuth
it 'requires the owner' do
subject.resource_owner = nil
subject.validate
expect(subject.error).to eq(:invalid_grant)
expect(subject.error).to eq(:invalid_resource_owner)
end

it 'optionally accepts the client' do
Expand Down

0 comments on commit 61eb6aa

Please sign in to comment.