diff options
author | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2017-02-07 13:15:58 +0100 |
---|---|---|
committer | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2017-02-07 13:15:58 +0100 |
commit | e217bb21a6c87b8599cb0ba1636928c2bd0ca814 (patch) | |
tree | d3f2bb025ea0e2c0cbc0f49aa6c64b6ba275262a | |
parent | 8753635c44f53c1b7b0266c66f36bf8134680d1a (diff) | |
download | gitlab-ce-e217bb21a6c87b8599cb0ba1636928c2bd0ca814.tar.gz |
Make headers asserts explicit in pagination specsfeature/gb/paginated-environments-api
-rw-r--r-- | spec/lib/gitlab/serializer/pagination_spec.rb | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/spec/lib/gitlab/serializer/pagination_spec.rb b/spec/lib/gitlab/serializer/pagination_spec.rb index 43d9782c3b7..519eb1b274f 100644 --- a/spec/lib/gitlab/serializer/pagination_spec.rb +++ b/spec/lib/gitlab/serializer/pagination_spec.rb @@ -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 |