Method: Shaf::Spec::IntegrationSpec#follow_rel

Defined in:
lib/shaf/spec/integration_spec.rb

#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