Sha256: 69f81ae243bc5d488083a334b7d0babdedf6ac8d0255e23e9e3b9d17f9c86705

Contents?: true

Size: 1.03 KB

Versions: 31

Compression:

Stored size: 1.03 KB

Contents

require 'spec_helper'

describe OpenIDConnect::Discovery::Principal do
  describe '.parse' do
    {
      'server.example.com' => OpenIDConnect::Discovery::Principal::URI,
      'http://server.example.com' => OpenIDConnect::Discovery::Principal::URI,
      'nov@server.example.com' => OpenIDConnect::Discovery::Principal::Email,
      '=nov' => OpenIDConnect::Discovery::Principal::XRI,
      '@nov' => OpenIDConnect::Discovery::Principal::XRI
    }.each do |input, klass|
      describe input do
        it do
          OpenIDConnect::Discovery::Principal.parse(input).should be_a klass
        end
      end
    end
  end

  describe '#discover!' do
    let(:request) { OpenIDConnect::Discovery::Principal.new.discover! }

    it 'should do SWD discovery' do
      SWD.should_receive(:discover!)
      request
    end

    context 'when discovery failed' do
      it do
        SWD.should_receive(:discover!).and_raise(SWD::Exception)
        expect { request }.should raise_error OpenIDConnect::Discovery::DiscoveryFailed
      end
    end
  end
end

Version data entries

31 entries across 31 versions & 1 rubygems

Version Path
openid_connect-0.2.1 spec/openid_connect/discovery/principal_spec.rb
openid_connect-0.2.0 spec/openid_connect/discovery/principal_spec.rb
openid_connect-0.2.0.alpha3 spec/openid_connect/discovery/principal_spec.rb
openid_connect-0.2.0.alpha2 spec/openid_connect/discovery/principal_spec.rb
openid_connect-0.2.0.alpha spec/openid_connect/discovery/principal_spec.rb
openid_connect-0.1.5 spec/openid_connect/discovery/principal_spec.rb
openid_connect-0.1.4 spec/openid_connect/discovery/principal_spec.rb
openid_connect-0.1.3 spec/openid_connect/discovery/principal_spec.rb
openid_connect-0.1.2 spec/openid_connect/discovery/principal_spec.rb
openid_connect-0.1.1 spec/openid_connect/discovery/principal_spec.rb
openid_connect-0.1.0 spec/openid_connect/discovery/principal_spec.rb
openid_connect-0.0.33 spec/openid_connect/discovery/principal_spec.rb
openid_connect-0.0.32 spec/openid_connect/discovery/principal_spec.rb
openid_connect-0.0.31 spec/openid_connect/discovery/principal_spec.rb
openid_connect-0.0.30 spec/openid_connect/discovery/principal_spec.rb
openid_connect-0.0.29 spec/openid_connect/discovery/principal_spec.rb
openid_connect-0.0.28 spec/openid_connect/discovery/principal_spec.rb
openid_connect-0.0.27 spec/openid_connect/discovery/principal_spec.rb
openid_connect-0.0.26 spec/openid_connect/discovery/principal_spec.rb
openid_connect-0.0.25 spec/openid_connect/discovery/principal_spec.rb