Skip to content

Commit ea4b078

Browse files
committed
Fix broken spec
1 parent fca3f51 commit ea4b078

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

test/xml_security_test.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ class XmlSecurityTest < Minitest::Test
302302
let (:response) { OneLogin::RubySaml::Response.new(fixture(:starfield_response)) }
303303

304304
before do
305-
response.settings = OneLogin::RubySaml::Settings.new( :idp_cert_fingerprint => "8D:BA:53:8E:A3:B6:F9:F1:69:6C:BB:D9:D8:BD:41:B3:AC:4F:9D:4D")
305+
response.settings = OneLogin::RubySaml::Settings.new(:idp_cert_fingerprint => "8D:BA:53:8E:A3:B6:F9:F1:69:6C:BB:D9:D8:BD:41:B3:AC:4F:9D:4D")
306306
end
307307

308308
it "be able to validate a good response" do
@@ -320,19 +320,19 @@ class XmlSecurityTest < Minitest::Test
320320
time_2 = 'Tue Nov 20 17:55:00 UTC 2012 < Wed Nov 28 17:53:45 UTC 2012'
321321

322322
errors = [time_1, time_2].map do |time|
323-
"Current time is earlier than NotBefore condition (#{time})"
323+
"Current time is earlier than NotBefore condition (#{time} - 1s)"
324324
end
325325

326-
assert_predicate response.errors & errors, :any?
326+
assert_predicate(response.errors & errors, :any?)
327327
end
328328
end
329329

330330
it "fail after response expires" do
331331
Timecop.freeze Time.parse('2012-11-30 17:55:00 UTC') do
332332
assert !response.is_valid?
333333

334-
contains_expected_error = response.errors.include? "Current time is on or after NotOnOrAfter condition (2012-11-30 17:55:00 UTC >= 2012-11-28 18:33:45 UTC)"
335-
contains_expected_error ||= response.errors.include? "Current time is on or after NotOnOrAfter condition (Fri Nov 30 17:55:00 UTC 2012 >= Wed Nov 28 18:33:45 UTC 2012)"
334+
contains_expected_error = response.errors.include?("Current time is on or after NotOnOrAfter condition (2012-11-30 17:55:00 UTC >= 2012-11-28 18:33:45 UTC + 1s)")
335+
contains_expected_error ||= response.errors.include?("Current time is on or after NotOnOrAfter condition (Fri Nov 30 17:55:00 UTC 2012 >= Wed Nov 28 18:33:45 UTC 2012 + 1s)")
336336
assert contains_expected_error
337337
end
338338
end

0 commit comments

Comments
 (0)