Class: Shaf::Spec::IntegrationSpec
Constant Summary
collapse
- TRANSACTION_OPTIONS =
{
rollback: :always,
savepoint: true,
auto_savepoint: true
}.freeze
Instance Method Summary
collapse
eval_method, register
#assert_attribute, #assert_has_attribute, #assert_has_attributes, #assert_has_embedded, #assert_has_link, #assert_has_links, #assert_header, #assert_link, #assert_status, #attributes, #embedded, #embedded_each, #embedded_resources, #fill_form, #last_payload, #link_rels, #links, #refute_has_attribute, #refute_has_attributes, #refute_has_embedded, #refute_has_link, #refute_has_links, #set_payload
#headers, #status
Instance Method Details
#app ⇒ Object
35
36
37
|
# File 'lib/shaf/spec/integration_spec.rb', line 35
def app
App.instance
end
|
#follow_rel(rel, method: nil) ⇒ Object
39
40
41
42
43
44
45
46
47
|
# File 'lib/shaf/spec/integration_spec.rb', line 39
def follow_rel(rel, method: nil)
assert_has_link(rel)
link = links[rel.to_sym]
if method && respond_to?(method)
public_send(method, link[:href])
else
get link[:href]
end
end
|
#parse_response(body) ⇒ Object
30
31
32
33
|
# File 'lib/shaf/spec/integration_spec.rb', line 30
def parse_response(body)
return nil if body.empty?
JSON.parse(body, symbolize_names: true)
end
|
24
25
26
27
28
|
# File 'lib/shaf/spec/integration_spec.rb', line 24
def
if defined?(@__integration_test_auth_token) && @__integration_test_auth_token
'X-AUTH-TOKEN', @__integration_test_auth_token
end
end
|