Skip to content

Commit

Permalink
:after_successful_authorization spec added
Browse files Browse the repository at this point in the history
  • Loading branch information
nattfodd committed Mar 26, 2018
1 parent 2ba531b commit a16de71
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions spec/controllers/authorizations_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -352,4 +352,16 @@ def translated_error_message(key)
expect(Doorkeeper::AccessToken.count).to eq 0
end
end

describe 'GET #new with callbacks' do
after do
allow(Doorkeeper.configuration).to receive(:skip_authorization).and_return(proc { true })
client.update_attribute :redirect_uri, 'urn:ietf:wg:oauth:2.0:oob'
get :new, client_id: client.uid, response_type: 'token', redirect_uri: client.redirect_uri
end

it 'should call :after_successful_authorization callback' do
expect(Doorkeeper.configuration).to receive_message_chain(:after_successful_authorization, :call).with(instance_of(described_class))
end
end
end

0 comments on commit a16de71

Please sign in to comment.