Skip to content

Commit 98fbcb6

Browse files
committed
Remove unnecessary alias test (this is covered elsewhere)
1 parent 4718345 commit 98fbcb6

File tree

2 files changed

+5
-16
lines changed

2 files changed

+5
-16
lines changed

test/onelogin_alias_test.rb

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -132,18 +132,6 @@ def generate_audience_error(expected, actual)
132132
assert_includes response.options.keys, :foo
133133
end
134134

135-
it "be able to parse a document which contains ampersands" do
136-
RubySaml::XML::SignedDocument.any_instance.stubs(:digests_match?).returns(true)
137-
OneLogin::RubySaml::Response.any_instance.stubs(:validate_conditions).returns(true)
138-
139-
ampersands_response = OneLogin::RubySaml::Response.new(ampersands_document)
140-
ampersands_response.settings = settings
141-
ampersands_response.settings.idp_cert_fingerprint = 'c51985d947f1be57082025050846eb27f6cab783'
142-
143-
assert !ampersands_response.is_valid?
144-
assert_includes ampersands_response.errors, "SAML Response must contain 1 assertion"
145-
end
146-
147135
describe "Prevent node text with comment attack (VU#475445)" do
148136
before do
149137
@response = OneLogin::RubySaml::Response.new(read_response('response_node_text_attack.xml.base64'))

test/xml_test.rb

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ class XmlTest < Minitest::Test
5252

5353
it "should raise Key validation error" do
5454
decoded_response.sub!("<ds:DigestValue>pJQ7MS/ek4KRRWGmv/H43ReHYMs=</ds:DigestValue>",
55-
"<ds:DigestValue>b9xsAXLsynugg3Wc1CI3kpWku+0=</ds:DigestValue>")
55+
"<ds:DigestValue>b9xsAXLsynugg3Wc1CI3kpWku+0=</ds:DigestValue>")
5656
mod_document = RubySaml::XML::SignedDocument.new(decoded_response)
5757
base64cert = mod_document.elements["//ds:X509Certificate"].text
5858
exception = assert_raises(RubySaml::ValidationError) do
@@ -63,13 +63,14 @@ class XmlTest < Minitest::Test
6363
end
6464

6565
it "correctly obtain the digest method with alternate namespace declaration" do
66-
adfs_document = RubySaml::XML::SignedDocument.new(fixture(:adfs_response_xmlns, false))
67-
base64cert = adfs_document.elements["//X509Certificate"].text
66+
adfs_document = fixture(:adfs_response_xmlns, false)
67+
base64cert = adfs_document[%r{<X509Certificate>(.*?)</X509Certificate>}, 1]
68+
adfs_document = RubySaml::XML::SignedDocument.new(adfs_document)
6869
assert adfs_document.validate_signature(base64cert, false)
6970
end
7071

7172
it "raise validation error when the X509Certificate is missing and no cert provided" do
72-
decoded_response.sub!(/<ds:X509Certificate>.*<\/ds:X509Certificate>/, "")
73+
decoded_response.sub!(%r{<ds:X509Certificate>.*</ds:X509Certificate>}, '')
7374
mod_document = RubySaml::XML::SignedDocument.new(decoded_response)
7475
exception = assert_raises(RubySaml::ValidationError) do
7576
mod_document.validate_document("a fingerprint", false) # The fingerprint isn't relevant to this test

0 commit comments

Comments
 (0)