Sha256: 60e69cb50f3243682c3fcd3cdfb2fd03f5437f2e30c10fd04ee6cb78f6ffaa8b

Contents?: true

Size: 669 Bytes

Versions: 11

Compression:

Stored size: 669 Bytes

Contents

require 'spec_helper'
require 'active_support/all'
require 'doorkeeper/errors'
require 'doorkeeper/server'

describe Doorkeeper::Server do
  let(:fake_class) { mock :fake_class }

  subject do
    described_class.new
  end

  describe '.authorization_request' do
    it 'raises error when strategy does not exist' do
      expect { subject.authorization_request(:duh) }.to raise_error(Doorkeeper::Errors::InvalidAuthorizationStrategy)
    end

    it 'builds the request with selected strategy' do
      stub_const 'Doorkeeper::Request::Code', fake_class
      fake_class.should_receive(:build).with(subject)
      subject.authorization_request :code
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
doorkeeper-0.7.1 spec/lib/server_spec.rb
doorkeeper-0.7.0 spec/lib/server_spec.rb
doorkeeper-0.6.7 spec/lib/server_spec.rb
doorkeeper-0.6.6 spec/lib/server_spec.rb
doorkeeper-0.6.5 spec/lib/server_spec.rb
doorkeeper-0.6.4 spec/lib/server_spec.rb
doorkeeper-0.6.3 spec/lib/server_spec.rb
doorkeeper-0.6.2 spec/lib/server_spec.rb
doorkeeper-0.6.1 spec/lib/server_spec.rb
doorkeeper-0.6.0 spec/lib/server_spec.rb
doorkeeper-0.6.0.rc1 spec/lib/server_spec.rb