Sha256: 8bc568bee7338549382ca1302946451bf9551c13529d77b806f5bc90e4af22c3
Contents?: true
Size: 502 Bytes
Versions: 2
Compression:
Stored size: 502 Bytes
Contents
RSpec::Matchers.define :have_pagination_links do |page| match do |response_headers| if page.nil? true else links = response_headers['Link'] || '' # see http://git.io/CUz3-Q rels = links.split(',').map{|link| link[/<.+?>; rel="(.*)"$/, 1]} rels.sort == ['first', 'prev'] end end description do %Q(include 'Link' (for pagination)) end failure_message_for_should do |response_headers| %Q(should #{description}, but are #{response_headers}) end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
rspec-api-0.2.0 | lib/rspec-api/matchers/page.rb |
rspec-api-0.1.2 | lib/rspec-api/matchers/page.rb |