module RESTful::Matchers
Constants
- VERSION
Public Instance Methods
have_link(rel, href = nil)
click to toggle source
Ensures that JSON response body has the given link.
Example:
response.body.should have_json_link("self", "http://example.com")
# File lib/restful/matchers/have_link.rb, line 12 def have_link(rel, href = nil) HaveLink.new(rel, href) end
Also aliased as: have_restful_json_link, have_restful_link
have_links(links)
click to toggle source
Ensures that JSON response body has the given links, represented as an array of hashes with ‘rel` and `href` keys.
Example:
response.body.should have_links([ { rel: "self", href: "http://example.com" }, { rel: "foo" , href: "http://example.com/foo" }, { rel: "bar" , href: "http://example.com/bar" } ])
# File lib/restful/matchers/have_links.rb, line 17 def have_links(links) HaveLinks.new(links) end
Also aliased as: have_restful_links