Permalink
Browse files

Changing from equality tests (since we cant guarantee order) to inclu…

…de? tests. More spots where UUID wasnt using generate
  • Loading branch information...
1 parent 5cadd5a commit 0ea41e0fa8707dbb7bebcf6215039c847a52c68b Sean Cashin committed with Feb 17, 2010
Showing with 8 additions and 6 deletions.
  1. +1 −1 lib/rsaml/protocol/message.rb
  2. +1 −1 test/assertion_test.rb
  3. +3 −2 test/issuer_test.rb
  4. +3 −2 test/name_test.rb
@@ -34,7 +34,7 @@ class Message
# Initialize the message instance
def initialize
- @id = UUID.new
+ @id = UUID.new.generate
@version = "2.0"
@issue_instant = Time.now.utc
end
@@ -89,7 +89,7 @@ class AssertionTest < Test::Unit::TestCase
should "optionally include advice" do
uri = 'http://example.com/some_advice'
advice = Advice.new
- advice.assertions << AssertionIDRef.new(UUID.new)
+ advice.assertions << AssertionIDRef.new(UUID.new.generate)
advice.assertions << AssertionURIRef.new(uri) # a URI
@assertion.advice << advice
xml = @assertion.to_xml
View
@@ -13,11 +13,12 @@ class IssuerTest < Test::Unit::TestCase
end
context "when producing xml" do
should "always include format and value" do
- assert_equal '<saml:Issuer Format="urn:oasis:names:tc:SAML:2.0:nameid-format:entity">Some Issuer</saml:Issuer>', @identifier.to_xml
+ assert @identifier.to_xml.include? 'Format="urn:oasis:names:tc:SAML:2.0:nameid-format:entity"'
+ assert @identifier.to_xml.include? 'Some Issuer'
end
should "optionally include a name qualifier" do
@identifier.name_qualifier = 'a_name_qualifier'
- assert_equal '<saml:Issuer Format="urn:oasis:names:tc:SAML:2.0:nameid-format:entity" NameQualifier="a_name_qualifier">Some Issuer</saml:Issuer>', @identifier.to_xml
+ assert @identifier.to_xml.include? 'NameQualifier="a_name_qualifier"'
end
should "optionally include an service provider name qualifier" do
@identifier.sp_name_qualifier = 'an_sp_name_qualifier'
View
@@ -13,11 +13,12 @@ class NameTest < Test::Unit::TestCase
end
context "when producing xml" do
should "always include format and value" do
- assert_equal '<saml:NameID Format="urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified">example</saml:NameID>', @name.to_xml
+ assert @name.to_xml.include? 'Format="urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified"'
+ assert @name.to_xml.include? 'example'
end
should "optionally include a name qualifier" do
@name.name_qualifier = 'a_name_qualifier'
- assert_equal '<saml:NameID Format="urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified" NameQualifier="a_name_qualifier">example</saml:NameID>', @name.to_xml
+ assert @name.to_xml.include? 'NameQualifier="a_name_qualifier"'
end
should "optionally include an service provider name qualifier" do
@name.sp_name_qualifier = 'an_sp_name_qualifier'

0 comments on commit 0ea41e0

Please sign in to comment.