summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2017-02-07 13:15:58 +0100
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2017-02-07 13:15:58 +0100
commite217bb21a6c87b8599cb0ba1636928c2bd0ca814 (patch)
treed3f2bb025ea0e2c0cbc0f49aa6c64b6ba275262a
parent8753635c44f53c1b7b0266c66f36bf8134680d1a (diff)
downloadgitlab-ce-e217bb21a6c87b8599cb0ba1636928c2bd0ca814.tar.gz
Make headers asserts explicit in pagination specsfeature/gb/paginated-environments-api
-rw-r--r--spec/lib/gitlab/serializer/pagination_spec.rb13
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