Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Léo-Paul Géneau
gitlab-ce
Commits
e217bb21
Commit
e217bb21
authored
Feb 07, 2017
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make headers asserts explicit in pagination specs
parent
8753635c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
5 deletions
+8
-5
spec/lib/gitlab/serializer/pagination_spec.rb
spec/lib/gitlab/serializer/pagination_spec.rb
+8
-5
No files found.
spec/lib/gitlab/serializer/pagination_spec.rb
View file @
e217bb21
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment