Sha256: 97ce89b059829f9454094754c857537d8a5c25533e697692a22a814cd92d3a86

Contents?: true

Size: 1.45 KB

Versions: 5

Compression:

Stored size: 1.45 KB

Contents

require File.expand_path(File.join(File.dirname(__FILE__), "test_helper"))

class SettingsTest < Test::Unit::TestCase

  context "Settings" do
    setup do
      @settings = Onelogin::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
      ]

      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 => "urn:oasis:names:tc:SAML:2.0:nameid-format:transient",
          :passive => true,
      }
      @settings = Onelogin::Saml::Settings.new(config)

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

  end

end

Version data entries

5 entries across 5 versions & 2 rubygems

Version Path
ruby-samlnechotech-0.7.24 test/settings_test.rb
ruby-samlnechotech-0.7.23 test/settings_test.rb
ruby-saml-nechotech-0.7.23 test/settings_test.rb
ruby-saml-nechotech-0.7.22 test/settings_test.rb
ruby-saml-nechotech-0.7.21 test/settings_test.rb