Module: TestHelper
Instance Method Summary collapse
- #all_endpoints ⇒ Object
- #json_discovery ⇒ Object
- #json_endpoints ⇒ Object
- #resource ⇒ Object
- #v2_endpoints ⇒ Object
- #validate_date_time(time) ⇒ Object
- #xml_discovery ⇒ Object
- #xml_endpoints ⇒ Object
Instance Method Details
#all_endpoints ⇒ Object
20 21 22 |
# File 'lib/test_helper.rb', line 20 def all_endpoints xml_endpoints + json_endpoints end |
#json_discovery ⇒ Object
32 33 34 |
# File 'lib/test_helper.rb', line 32 def json_discovery @session.discovery.raw.json.response end |
#json_endpoints ⇒ Object
16 17 18 |
# File 'lib/test_helper.rb', line 16 def json_endpoints @session.discovery.raw.json.response.endpoints end |
#resource ⇒ Object
8 9 10 |
# File 'lib/test_helper.rb', line 8 def resource @session.resource end |
#v2_endpoints ⇒ Object
24 25 26 |
# File 'lib/test_helper.rb', line 24 def v2_endpoints all_endpoints.select{|endpoint| endpoint.specification =~ /^.*_v2$/i } end |
#validate_date_time(time) ⇒ Object
4 5 6 |
# File 'lib/test_helper.rb', line 4 def validate_date_time(time) time.is_a?(Time) ? time : Time.iso8601(time) rescue false end |
#xml_discovery ⇒ Object
28 29 30 |
# File 'lib/test_helper.rb', line 28 def xml_discovery @session.discovery.raw.xml.response.discovery end |
#xml_endpoints ⇒ Object
12 13 14 |
# File 'lib/test_helper.rb', line 12 def xml_endpoints @session.discovery.raw.xml.response.discovery.endpoints.endpoint end |