BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
e15f15d5
Unverified
Commit
e15f15d5
authored
Oct 21, 2016
by
Airat Shigapov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add test for events order in API
parent
3685e867
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
0 deletions
+20
-0
users_spec.rb
spec/requests/api/users_spec.rb
+20
-0
No files found.
spec/requests/api/users_spec.rb
View file @
e15f15d5
...
@@ -958,6 +958,26 @@ describe API::API, api: true do
...
@@ -958,6 +958,26 @@ describe API::API, api: true do
expect
(
joined_event
[
'author'
][
'name'
]).
to
eq
(
user
.
name
)
expect
(
joined_event
[
'author'
][
'name'
]).
to
eq
(
user
.
name
)
end
end
end
end
context
'when there are multiple events'
do
let
(
:old_note
)
{
create
(
:note_on_issue
,
project:
project
)
}
let
(
:new_event
)
{
note
.
events
.
first
}
let
(
:old_event
)
{
old_note
.
events
.
first
}
before
do
EventCreateService
.
new
.
leave_note
(
old_note
,
user
)
new_event
.
update
(
id:
1000
)
old_event
.
update
(
id:
900
)
end
it
'returns them in the correct order (from newest to oldest determined by ID field)'
do
get
api
(
"/users/
#{
user
.
id
}
/events"
,
user
)
expect
(
json_response
[
0
][
'target_id'
]).
to
eq
(
note
.
id
)
expect
(
json_response
[
1
][
'target_id'
]).
to
eq
(
old_note
.
id
)
end
end
end
end
it
'returns a 404 error if not found'
do
it
'returns a 404 error if not found'
do
...
...
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