Sha256: 5e6352756519937d7e1acdff76a7d6e63ad1172c8e1359c3019fa2ca18394339
Contents?: true
Size: 1.34 KB
Versions: 23
Compression:
Stored size: 1.34 KB
Contents
require 'spec_helper_integration' feature 'Skip authorization form' do background do config_is_set(:authenticate_resource_owner) { User.first || redirect_to('/sign_in') } client_exists default_scopes_exist :public optional_scopes_exist :write end context 'for previously authorized clients' do background do create_resource_owner sign_in end scenario 'skips the authorization and return a new grant code' do client_is_authorized(@client, @resource_owner, :scopes => "public") visit authorization_endpoint_url(:client => @client) i_should_not_see "Authorize" client_should_be_authorized @client i_should_be_on_client_callback @client url_should_have_param "code", Doorkeeper::AccessGrant.first.token end scenario 'does not skip authorization when scopes differ' do client_is_authorized(@client, @resource_owner, :scopes => "public write") visit authorization_endpoint_url(:client => @client, :scope => "public") i_should_see "Authorize" end scenario 'creates grant with new scope when scopes differ' do client_is_authorized(@client, @resource_owner, :scopes => "public write") visit authorization_endpoint_url(:client => @client, :scope => "public") click_on "Authorize" access_grant_should_have_scopes :public end end end
Version data entries
23 entries across 23 versions & 1 rubygems