Sha256: 4246a1fed71e052a47f26e16fc6ea3a770529f6e67ed5158b12e55049f41bceb

Contents?: true

Size: 831 Bytes

Versions: 4

Compression:

Stored size: 831 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
      response.status.should == 401
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
doorkeeper-0.6.2 spec/controllers/tokens_controller_spec.rb
doorkeeper-0.6.1 spec/controllers/tokens_controller_spec.rb
doorkeeper-0.6.0 spec/controllers/tokens_controller_spec.rb
doorkeeper-0.6.0.rc1 spec/controllers/tokens_controller_spec.rb