# frozen_string_literal: true require 'fast_spec_helper' RSpec.describe Gitlab::Utils::LinkHeaderParser do let(:parser) { described_class.new(header) } describe '#parse' do subject { parser.parse } context 'with a valid header' do let(:header) { generate_header(next: 'http://sandbox.org/next') } let(:expected) { { next: { uri: URI('http://sandbox.org/next') } } } it { is_expected.to eq(expected) } context 'with multiple links' do let(:header) { generate_header(next: 'http://sandbox.org/next', previous: 'http://sandbox.org/previous') } let(:expected) do { next: { uri: URI('http://sandbox.org/next') }, previous: { uri: URI('http://sandbox.org/previous') } } end it { is_expected.to eq(expected) } end context 'with an incomplete uri' do let(:header) { '