Sha256: d354c3dec5452272f89b7604aac5f0542c8e634fa16830d4d4ec2032208de313

Contents?: true

Size: 1.35 KB

Versions: 52

Compression:

Stored size: 1.35 KB

Contents

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

class SettingsTest < Test::Unit::TestCase

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

      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",
      }
      @settings = Spid::Saml::Settings.new(config)

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

  end

end

Version data entries

52 entries across 52 versions & 1 rubygems

Version Path
spid-es-0.0.52 test/settings_test.rb
spid-es-0.0.51 test/settings_test.rb
spid-es-0.0.50 test/settings_test.rb
spid-es-0.0.49 test/settings_test.rb
spid-es-0.0.48 test/settings_test.rb
spid-es-0.0.47 test/settings_test.rb
spid-es-0.0.46 test/settings_test.rb
spid-es-0.0.45 test/settings_test.rb
spid-es-0.0.44 test/settings_test.rb
spid-es-0.0.43 test/settings_test.rb
spid-es-0.0.42 test/settings_test.rb
spid-es-0.0.41 test/settings_test.rb
spid-es-0.0.40 test/settings_test.rb
spid-es-0.0.39 test/settings_test.rb
spid-es-0.0.38 test/settings_test.rb
spid-es-0.0.37 test/settings_test.rb
spid-es-0.0.36 test/settings_test.rb
spid-es-0.0.35 test/settings_test.rb
spid-es-0.0.34 test/settings_test.rb
spid-es-0.0.33 test/settings_test.rb