Sha256: c6c6b1c0fbdbf59cd5997896996b762fd08584b6a2057b7c31ec90d55daf0bc3

Contents?: true

Size: 881 Bytes

Versions: 7

Compression:

Stored size: 881 Bytes

Contents

require 'spec_helper'

describe Gitlab::PageLinks do
  before do
    @page_links = Gitlab::PageLinks.new('Link' => "<http://example.com/api/v3/projects?page=1&per_page=5>; rel=\"first\", <http://example.com/api/v3/projects?page=20&per_page=5>; rel=\"last\", <http://example.com/api/v3/projects?page=7&per_page=5>; rel=\"prev\", <http://example.com/api/v3/projects?page=9&per_page=5>; rel=\"next\"")
  end

  context '.extract_links' do
    it 'should extract link header appropriately' do
      expect(@page_links.last).to eql 'http://example.com/api/v3/projects?page=20&per_page=5'
      expect(@page_links.first).to eql 'http://example.com/api/v3/projects?page=1&per_page=5'
      expect(@page_links.next).to eql 'http://example.com/api/v3/projects?page=9&per_page=5'
      expect(@page_links.prev).to eql 'http://example.com/api/v3/projects?page=7&per_page=5'
    end
  end
end

Version data entries

7 entries across 7 versions & 2 rubygems

Version Path
gitlab-4.2.0 spec/gitlab/page_links_spec.rb
gitlab-4.1.0 spec/gitlab/page_links_spec.rb
gitlab-4.0.0 spec/gitlab/page_links_spec.rb
gitlab-akerl-4.0.0 spec/gitlab/page_links_spec.rb
gitlab-3.7.0 spec/gitlab/page_links_spec.rb
gitlab-3.6.1 spec/gitlab/page_links_spec.rb
gitlab-3.6.0 spec/gitlab/page_links_spec.rb