Sha256: 4d698f1d9fa4f96bb535104c4a38ee00dbab49641b2abb0a8a819c1fc7857928
Contents?: true
Size: 490 Bytes
Versions: 68
Compression:
Stored size: 490 Bytes
Contents
module LinksHelper LINKS_PATTERN = /\<(.*?)\>; rel="(\w+)"/ def assert_link(rel, url) assert_includes response_links, rel assert_equal url, response_links[rel], %(rel="#{rel}" is incorrect) end def assert_no_link(rel) assert_nil response_links[rel], %(expected rel="#{rel}" to be nil) end private def response_links @response_links ||= begin links = response.headers['Link'].to_s links.scan(LINKS_PATTERN).map(&:reverse).to_h end end end
Version data entries
68 entries across 68 versions & 1 rubygems