Commit e217bb21 authored by Grzegorz Bizon's avatar Grzegorz Bizon

Make headers asserts explicit in pagination specs

parent 8753635c
......@@ -3,11 +3,14 @@ require 'spec_helper'
describe Gitlab::Serializer::Pagination do
let(:request) { spy('request') }
let(:response) { spy('response') }
let(:headers) { spy('headers') }
before do
allow(request)
.to receive(:query_parameters)
allow(request).to receive(:query_parameters)
.and_return(params)
allow(response).to receive(:headers)
.and_return(headers)
end
let(:pagination) { described_class.new(request, response) }
......@@ -26,9 +29,9 @@ describe Gitlab::Serializer::Pagination do
end
it 'appends relevant headers' do
expect(response).to receive(:[]=).with('X-Total', '3')
expect(response).to receive(:[]=).with('X-Total-Pages', '2')
expect(response).to receive(:[]=).with('X-Per-Page', '2')
expect(headers).to receive(:[]=).with('X-Total', '3')
expect(headers).to receive(:[]=).with('X-Total-Pages', '2')
expect(headers).to receive(:[]=).with('X-Per-Page', '2')
subject
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment