Sha256: ac617219b3c124dbb9e7acecf857d89df5dc61b5525fdd95cf6eb6e88c543f38

Contents?: true

Size: 1.71 KB

Versions: 38

Compression:

Stored size: 1.71 KB

Contents

require File.expand_path('../../../test_helper', __FILE__)

module Maestrano
  module Saml
    class SettingsTest < Test::Unit::TestCase

      context "Settings" do
        setup do
          @settings = Maestrano::Saml::Settings.new
        end
        should "should provide getters and settings" do
          accessors = [
            :assertion_consumer_service_url, :issuer, :sp_name_qualifier,
            :idp_sso_target_url, :idp_cert_fingerprint, :name_identifier_format,
            :idp_slo_target_url, :name_identifier_value, :sessionindex,
            :assertion_consumer_logout_service_url,
            :passive, :protocol_binding
          ]

          accessors.each do |accessor|
            value = Kernel.rand
            @settings.send("#{accessor}=".to_sym, value)
            assert_equal value, @settings.send(accessor)
          end
        end

        should "create settings from hash" do

          config = {
              :assertion_consumer_service_url => "http://app.muda.no/sso",
              :issuer => "http://muda.no",
              :sp_name_qualifier => "http://sso.muda.no",
              :idp_sso_target_url => "http://sso.muda.no/sso",
              :idp_slo_target_url => "http://sso.muda.no/slo",
              :idp_cert_fingerprint => "00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00",
              :name_identifier_format => Maestrano::Saml::Settings::NAMEID_TRANSIENT,
              :passive => true,
              :protocol_binding => Maestrano::Saml::Settings::PROTOCOL_BINDING_POST
          }
          @settings = Maestrano::Saml::Settings.new(config)

          config.each do |k,v|
            assert_equal v, @settings.send(k)
          end
        end

      end

    end
  end
end

Version data entries

38 entries across 38 versions & 2 rubygems

Version Path
maestrano-1.0.6 test/maestrano/saml/settings_test.rb
maestrano-1.0.5 test/maestrano/saml/settings_test.rb
maestrano-1.0.4 test/maestrano/saml/settings_test.rb
maestrano-1.0.3 test/maestrano/saml/settings_test.rb
maestrano-1.0.2 test/maestrano/saml/settings_test.rb
maestrano-1.0.1 test/maestrano/saml/settings_test.rb
maestrano-1.0.0 test/maestrano/saml/settings_test.rb
maestrano-1.0.0.pre.RC9 test/maestrano/saml/settings_test.rb
maestrano-1.0.0.pre.RC8 test/maestrano/saml/settings_test.rb
maestrano-1.0.0.pre.RC7 test/maestrano/saml/settings_test.rb
maestrano-1.0.0.pre.RC6 test/maestrano/saml/settings_test.rb
maestrano-1.0.0.pre.RC5 test/maestrano/saml/settings_test.rb
maestrano-1.0.0.pre.RC4 test/maestrano/saml/settings_test.rb
maestrano-1.0.0.pre.RC3 test/maestrano/saml/settings_test.rb
maestrano-1.0.0.pre.RC2 test/maestrano/saml/settings_test.rb
maestrano-1.0.0.pre.RC1 test/maestrano/saml/settings_test.rb
maestrano-0.12.5 test/maestrano/saml/settings_test.rb
maestrano-0.12.4 test/maestrano/saml/settings_test.rb
maestrano-0.12.3 test/maestrano/saml/settings_test.rb
maestrano-0.12.2 test/maestrano/saml/settings_test.rb