Module: TestHelper

Extended by:
TestHelper
Included in:
TestHelper
Defined in:
lib/test_helper.rb

Instance Method Summary collapse

Instance Method Details

#all_endpointsObject



20
21
22
# File 'lib/test_helper.rb', line 20

def all_endpoints
  xml_endpoints + json_endpoints
end

#json_discoveryObject



32
33
34
# File 'lib/test_helper.rb', line 32

def json_discovery
  @session.discovery.raw.json.response
end

#json_endpointsObject



16
17
18
# File 'lib/test_helper.rb', line 16

def json_endpoints
  @session.discovery.raw.json.response.endpoints
end

#resourceObject



8
9
10
# File 'lib/test_helper.rb', line 8

def resource
  @session.resource
end

#v2_endpointsObject



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_discoveryObject



28
29
30
# File 'lib/test_helper.rb', line 28

def xml_discovery
  @session.discovery.raw.xml.response.discovery
end

#xml_endpointsObject



12
13
14
# File 'lib/test_helper.rb', line 12

def xml_endpoints
  @session.discovery.raw.xml.response.discovery.endpoints.endpoint
end