Skip to content

Commit 37a892d

Browse files
committed
Merge branch 'master' of github.com:onelogin/ruby-saml
2 parents c2e52de + 83c1a6e commit 37a892d

File tree

6 files changed

+23
-14
lines changed

6 files changed

+23
-14
lines changed

.travis.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ rvm:
44
- 1.9.3
55
- 2.0.0
66
- 2.1.5
7+
- 2.2.0
78
- ree
89
gemfile:
910
- Gemfile
@@ -13,4 +14,4 @@ matrix:
1314
- rvm: 1.8.7
1415
gemfile: Gemfile
1516
- rvm: ree
16-
gemfile: Gemfile
17+
gemfile: Gemfile

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#
22
# Please keep this file alphabetized and organized
33
#
4-
source 'http://rubygems.org'
4+
source 'https://rubygems.org'
55

66
gemspec

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ We created a demo project for Rails4 that uses the latest version of this librar
1818
* 1.8.7
1919
* 1.9.x
2020
* 2.1.x
21-
* 2.2 (not yet officially supported)
21+
* 2.2.0
2222

2323
## Adding Features, Pull Requests
2424
* Fork the repository

gemfiles/nokogiri-1.5.gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
source 'http://rubygems.org'
1+
source 'https://rubygems.org'
22

33
gem "nokogiri", "~> 1.5.10"
44

test/response_test.rb

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -195,15 +195,23 @@ class RubySamlTest < Minitest::Test
195195
assert response.send(:validate_conditions, true)
196196
end
197197

198-
it "optionally allow for clock drift" do
198+
it "optionally allows for clock drift" do
199199
# The NotBefore condition in the document is 2011-06-14T18:21:01.516Z
200-
Time.stubs(:now).returns(Time.parse("2011-06-14T18:21:01Z"))
201-
response = OneLogin::RubySaml::Response.new(response_document_5, :allowed_clock_drift => 0.515)
202-
assert !response.send(:validate_conditions, true)
200+
Timecop.freeze(Time.parse("2011-06-14T18:21:01Z")) do
201+
response = OneLogin::RubySaml::Response.new(
202+
response_document_5,
203+
:allowed_clock_drift => 0.515
204+
)
205+
assert !response.send(:validate_conditions, true)
206+
end
203207

204-
Time.stubs(:now).returns(Time.parse("2011-06-14T18:21:01Z"))
205-
response = OneLogin::RubySaml::Response.new(response_document_5, :allowed_clock_drift => 0.516)
206-
assert response.send(:validate_conditions, true)
208+
Timecop.freeze(Time.parse("2011-06-14T18:21:01Z")) do
209+
response = OneLogin::RubySaml::Response.new(
210+
response_document_5,
211+
:allowed_clock_drift => 0.516
212+
)
213+
assert response.send(:validate_conditions, true)
214+
end
207215
end
208216
end
209217

test/xml_security_test.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ class XmlSecurityTest < Minitest::Test
157157

158158
# verify our signature
159159
signed_doc = XMLSecurity::SignedDocument.new(request.to_s)
160-
signed_doc.validate_document(ruby_saml_cert_fingerprint, false)
160+
assert signed_doc.validate_document(ruby_saml_cert_fingerprint, false)
161161
end
162162

163163
it "sign a LogoutRequest" do
@@ -173,7 +173,7 @@ class XmlSecurityTest < Minitest::Test
173173

174174
# verify our signature
175175
signed_doc = XMLSecurity::SignedDocument.new(request.to_s)
176-
signed_doc.validate_document(ruby_saml_cert_fingerprint, false)
176+
assert signed_doc.validate_document(ruby_saml_cert_fingerprint, false)
177177
end
178178

179179
it "sign a LogoutResponse" do
@@ -189,7 +189,7 @@ class XmlSecurityTest < Minitest::Test
189189

190190
# verify our signature
191191
signed_doc = XMLSecurity::SignedDocument.new(response.to_s)
192-
signed_doc.validate_document(ruby_saml_cert_fingerprint, false)
192+
assert signed_doc.validate_document(ruby_saml_cert_fingerprint, false)
193193
end
194194
end
195195

0 commit comments

Comments
 (0)