diff options
author | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2017-02-10 09:36:52 +0100 |
---|---|---|
committer | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2017-02-10 09:36:52 +0100 |
commit | d0d94e4f104c276ee4095a76d1204daae384c708 (patch) | |
tree | ba9d19ebe45aa837d27bbf0d954d9e7d991dc3aa /spec/serializers/environment_serializer_spec.rb | |
parent | 482e7ff01201dba89a13f5e9979ea17c202c87c7 (diff) | |
download | gitlab-ce-d0d94e4f104c276ee4095a76d1204daae384c708.tar.gz |
Fix pagination headers in grouped environments API
Diffstat (limited to 'spec/serializers/environment_serializer_spec.rb')
-rw-r--r-- | spec/serializers/environment_serializer_spec.rb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/spec/serializers/environment_serializer_spec.rb b/spec/serializers/environment_serializer_spec.rb index 1b95f1ff198..6a6df377b35 100644 --- a/spec/serializers/environment_serializer_spec.rb +++ b/spec/serializers/environment_serializer_spec.rb @@ -181,6 +181,17 @@ describe EnvironmentSerializer do expect(subject.first[:name]).to eq 'production' expect(subject.second[:name]).to eq 'staging' end + + it 'appends correct total page count header' do + expect(subject).not_to be_empty + expect(response).to have_received(:[]=).with('X-Total', '3') + end + + it 'appends correct page count headers' do + expect(subject).not_to be_empty + expect(response).to have_received(:[]=).with('X-Total-Pages', '2') + expect(response).to have_received(:[]=).with('X-Per-Page', '2') + end end end end |