Sha256: 616504089d43fee9a816f6541d9e010e4c085726f578a9d401a8fa41228c841b

Contents?: true

Size: 835 Bytes

Versions: 10

Compression:

Stored size: 835 Bytes

Contents

require 'spec_helper_integration'

describe Doorkeeper::TokensController do
  describe "when authorization has succeeded" do
    let :token do
      double(:token, :authorize => true)
    end

    before do
      controller.stub(:token) { token }
    end

    it "returns the authorization" do
      pending 'verify need of these specs'
      token.should_receive(:authorization)
      post :create
    end
  end

  describe "when authorization has failed" do
    let :token do
      double(:token, :authorize => false)
    end

    before do
      controller.stub(:token) { token }
    end

    it "returns the error response" do
      pending 'verify need of these specs'
      token.stub(:error_response => stub(:to_json => [], :status => :unauthorized))
      post :create
      expect(response.status).to eq 401
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
doorkeeper-0.7.4 spec/controllers/tokens_controller_spec.rb
doorkeeper-0.7.3 spec/controllers/tokens_controller_spec.rb
doorkeeper-0.7.2 spec/controllers/tokens_controller_spec.rb
doorkeeper-0.7.1 spec/controllers/tokens_controller_spec.rb
doorkeeper-0.7.0 spec/controllers/tokens_controller_spec.rb
doorkeeper-0.6.7 spec/controllers/tokens_controller_spec.rb
doorkeeper-0.6.6 spec/controllers/tokens_controller_spec.rb
doorkeeper-0.6.5 spec/controllers/tokens_controller_spec.rb
doorkeeper-0.6.4 spec/controllers/tokens_controller_spec.rb
doorkeeper-0.6.3 spec/controllers/tokens_controller_spec.rb