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' ...@@ -3,11 +3,14 @@ require 'spec_helper'
describe Gitlab::Serializer::Pagination do describe Gitlab::Serializer::Pagination do
let(:request) { spy('request') } let(:request) { spy('request') }
let(:response) { spy('response') } let(:response) { spy('response') }
let(:headers) { spy('headers') }
before do before do
allow(request) allow(request).to receive(:query_parameters)
.to receive(:query_parameters)
.and_return(params) .and_return(params)
allow(response).to receive(:headers)
.and_return(headers)
end end
let(:pagination) { described_class.new(request, response) } let(:pagination) { described_class.new(request, response) }
...@@ -26,9 +29,9 @@ describe Gitlab::Serializer::Pagination do ...@@ -26,9 +29,9 @@ describe Gitlab::Serializer::Pagination do
end end
it 'appends relevant headers' do it 'appends relevant headers' do
expect(response).to receive(:[]=).with('X-Total', '3') expect(headers).to receive(:[]=).with('X-Total', '3')
expect(response).to receive(:[]=).with('X-Total-Pages', '2') expect(headers).to receive(:[]=).with('X-Total-Pages', '2')
expect(response).to receive(:[]=).with('X-Per-Page', '2') expect(headers).to receive(:[]=).with('X-Per-Page', '2')
subject subject
end 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