Sha256: d9a89e40bcb423d92ab710b02d5aac85ef3632d829a01b70ab5444fac3cfd7f5

Contents?: true

Size: 1019 Bytes

Versions: 30

Compression:

Stored size: 1019 Bytes

Contents

require 'spec_helper'

module Doorkeeper
  module OAuth
    describe CodeResponse do
      describe '.redirect_uri' do
        context 'when generating the redirect URI for an implicit grant' do
          let :pre_auth do
            double(
              :pre_auth,
              client: double(:application, id: 1),
              redirect_uri: 'http://tst.com/cb',
              state: nil,
              scopes: Scopes.from_string('public'),
            )
          end

          let :auth do
            Authorization::Token.new(pre_auth, double(id: 1)).tap do |c|
              c.issue_token
              allow(c.token).to receive(:expires_in_seconds).and_return(3600)
            end
          end

          subject { CodeResponse.new(pre_auth, auth, response_on_fragment: true).redirect_uri }

          it 'includes the remaining TTL of the token relative to the time the token was generated' do
            expect(subject).to include('expires_in=3600')
          end
        end
      end
    end
  end
end

Version data entries

30 entries across 30 versions & 3 rubygems

Version Path
doorkeeper-mongodb-4.2.0 spec/lib/oauth/code_response_spec.rb
doorkeeper-sequel-1.5.0 spec/lib/oauth/code_response_spec.rb
doorkeeper-4.4.3 spec/lib/oauth/code_response_spec.rb
doorkeeper-5.0.0 spec/lib/oauth/code_response_spec.rb
doorkeeper-4.4.2 spec/lib/oauth/code_response_spec.rb
doorkeeper-4.4.1 spec/lib/oauth/code_response_spec.rb
doorkeeper-5.0.0.rc2 spec/lib/oauth/code_response_spec.rb
doorkeeper-4.4.0 spec/lib/oauth/code_response_spec.rb
doorkeeper-5.0.0.rc1 spec/lib/oauth/code_response_spec.rb
doorkeeper-mongodb-4.1.0 spec/lib/oauth/code_response_spec.rb
doorkeeper-4.3.2 spec/lib/oauth/code_response_spec.rb
doorkeeper-4.3.1 spec/lib/oauth/code_response_spec.rb
doorkeeper-4.3.0 spec/lib/oauth/code_response_spec.rb
doorkeeper-sequel-1.4.0 spec/lib/oauth/code_response_spec.rb
doorkeeper-mongodb-4.0.1 spec/lib/oauth/code_response_spec.rb
doorkeeper-mongodb-4.0.0 spec/lib/oauth/code_response_spec.rb
doorkeeper-sequel-1.3.1 spec/lib/oauth/code_response_spec.rb
doorkeeper-sequel-1.3.0 spec/lib/oauth/code_response_spec.rb
doorkeeper-sequel-1.2.3 spec/lib/oauth/code_response_spec.rb
doorkeeper-sequel-1.2.2 spec/lib/oauth/code_response_spec.rb