Sha256: e5715fb798e9381ac9f151bf8948ac7a14234e4439c153f15af5d987bb8826ab

Contents?: true

Size: 1.69 KB

Versions: 48

Compression:

Stored size: 1.69 KB

Contents

require 'spec_helper.rb'

describe Rack::OAuth2::Server::Abstract::Error do

  context 'when full attributes are given' do
    subject do
      Rack::OAuth2::Server::Abstract::Error.new 400, :invalid_request, 'Missing some required params', uri: 'http://server.example.com/error'
    end
    its(:status)      { should == 400 }
    its(:error)       { should == :invalid_request }
    its(:description) { should == 'Missing some required params' }
    its(:uri)         { should == 'http://server.example.com/error' }
    its(:protocol_params) do
      should == {
        error:             :invalid_request,
        error_description: 'Missing some required params',
        error_uri:         'http://server.example.com/error'
      }
    end
  end

  context 'when optional attributes are not given' do
    subject do
      Rack::OAuth2::Server::Abstract::Error.new 400, :invalid_request
    end
    its(:status)      { should == 400 }
    its(:error)       { should == :invalid_request }
    its(:description) { should be_nil }
    its(:uri)         { should be_nil }
    its(:protocol_params) do
      should == {
        error:             :invalid_request,
        error_description: nil,
        error_uri:         nil
      }
    end
  end

end

describe Rack::OAuth2::Server::Abstract::BadRequest do
  its(:status) { should == 400 }
end

describe Rack::OAuth2::Server::Abstract::Unauthorized do
  its(:status) { should == 401 }
end

describe Rack::OAuth2::Server::Abstract::Forbidden do
  its(:status) { should == 403 }
end

describe Rack::OAuth2::Server::Abstract::ServerError do
  its(:status) { should == 500 }
end

describe Rack::OAuth2::Server::Abstract::TemporarilyUnavailable do
  its(:status) { should == 503 }
end

Version data entries

48 entries across 48 versions & 1 rubygems

Version Path
rack-oauth2-2.2.1 spec/rack/oauth2/server/abstract/error_spec.rb
rack-oauth2-2.2.0 spec/rack/oauth2/server/abstract/error_spec.rb
rack-oauth2-2.1.0 spec/rack/oauth2/server/abstract/error_spec.rb
rack-oauth2-2.0.1 spec/rack/oauth2/server/abstract/error_spec.rb
rack-oauth2-2.0.0 spec/rack/oauth2/server/abstract/error_spec.rb
rack-oauth2-2.0.0.rc3 spec/rack/oauth2/server/abstract/error_spec.rb
rack-oauth2-2.0.0.rc2 spec/rack/oauth2/server/abstract/error_spec.rb
rack-oauth2-2.0.0.rc1 spec/rack/oauth2/server/abstract/error_spec.rb
rack-oauth2-1.21.3 spec/rack/oauth2/server/abstract/error_spec.rb
rack-oauth2-1.21.2 spec/rack/oauth2/server/abstract/error_spec.rb
rack-oauth2-1.21.1 spec/rack/oauth2/server/abstract/error_spec.rb
rack-oauth2-1.21.0 spec/rack/oauth2/server/abstract/error_spec.rb
rack-oauth2-1.20.0 spec/rack/oauth2/server/abstract/error_spec.rb
rack-oauth2-1.19.0 spec/rack/oauth2/server/abstract/error_spec.rb
rack-oauth2-1.18.0 spec/rack/oauth2/server/abstract/error_spec.rb
rack-oauth2-1.17.0 spec/rack/oauth2/server/abstract/error_spec.rb
rack-oauth2-1.16.0 spec/rack/oauth2/server/abstract/error_spec.rb
rack-oauth2-1.15.0 spec/rack/oauth2/server/abstract/error_spec.rb
rack-oauth2-1.14.0 spec/rack/oauth2/server/abstract/error_spec.rb
rack-oauth2-1.13.0 spec/rack/oauth2/server/abstract/error_spec.rb