File: existing_headers.rb

package info (click to toggle)
ruby-api-pagination 4.8.2-2
  • links: PTS, VCS
  • area: main
  • in suites:
  • size: 272 kB
  • sloc: ruby: 1,125; makefile: 3
file content (14 lines) | stat: -rw-r--r-- 527 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
shared_examples 'an endpoint with existing Link headers' do
  it 'should keep existing Links' do
    expect(links).to include('<http://example.org/numbers?count=30>; rel="without"')
  end

  it 'should contain pagination Links' do
    expect(links).to include('<http://example.org/numbers?count=30&page=2&with_headers=true>; rel="next"')
    expect(links).to include('<http://example.org/numbers?count=30&page=3&with_headers=true>; rel="last"')
  end

  it 'should give a Total header' do
    expect(total).to eq(30)
  end
end