summaryrefslogtreecommitdiff
path: root/spec/serializers/environment_serializer_spec.rb
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2017-02-10 09:36:52 +0100
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2017-02-10 09:36:52 +0100
commitd0d94e4f104c276ee4095a76d1204daae384c708 (patch)
treeba9d19ebe45aa837d27bbf0d954d9e7d991dc3aa /spec/serializers/environment_serializer_spec.rb
parent482e7ff01201dba89a13f5e9979ea17c202c87c7 (diff)
downloadgitlab-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.rb11
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