test/ruby-saml_test.rb in ruby-saml-0.3.4 vs test/ruby-saml_test.rb in ruby-saml-0.4.0

- old
+ new

@@ -33,10 +33,12 @@ should "adapt namespace" do response = Onelogin::Saml::Response.new(response_document) assert !response.name_id.nil? response = Onelogin::Saml::Response.new(response_document_2) assert !response.name_id.nil? + response = Onelogin::Saml::Response.new(response_document_3) + assert !response.name_id.nil? end context "#is_valid?" do should "return false when response is initialized with blank data" do response = Onelogin::Saml::Response.new('') @@ -63,10 +65,13 @@ context "#name_id" do should "extract the value of the name id element" do response = Onelogin::Saml::Response.new(response_document) assert_equal "support@onelogin.com", response.name_id + + response = Onelogin::Saml::Response.new(response_document_3) + assert_equal "someone@example.com", response.name_id end end context "#attributes" do should "extract the first attribute in a hash accessed via its symbol" do @@ -82,15 +87,23 @@ should "extract all attributes" do response = Onelogin::Saml::Response.new(response_document) assert_equal "demo", response.attributes[:uid] assert_equal "value", response.attributes[:another_value] end + + should "work for implicit namespaces" do + response = Onelogin::Saml::Response.new(response_document_3) + assert_equal "someone@example.com", response.attributes["http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress"] + end end context "#session_expires_at" do should "extract the value of the SessionNotOnOrAfter attribute" do response = Onelogin::Saml::Response.new(response_document) assert response.session_expires_at.is_a?(Time) + + response = Onelogin::Saml::Response.new(response_document_2) + assert response.session_expires_at.nil? end end end context "Authrequest" do