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
Jérome Perrin
gitlab-ce
Commits
c7865786
Commit
c7865786
authored
Oct 11, 2016
by
Rémy Coutable
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make spec deterministic
Signed-off-by:
Rémy Coutable
<
remy@rymai.me
>
parent
8e70cf25
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
11 deletions
+9
-11
spec/requests/api/users_spec.rb
spec/requests/api/users_spec.rb
+9
-11
No files found.
spec/requests/api/users_spec.rb
View file @
c7865786
...
@@ -926,20 +926,18 @@ describe API::API, api: true do
...
@@ -926,20 +926,18 @@ describe API::API, api: true do
it
'returns the "joined" event'
do
it
'returns the "joined" event'
do
get
api
(
"/users/
#{
user
.
id
}
/events"
,
user
)
get
api
(
"/users/
#{
user
.
id
}
/events"
,
user
)
first_event
=
json_response
.
first
comment_event
=
json_response
.
find
{
|
e
|
e
[
'action_name'
]
==
'commented on'
}
expect
(
first_event
[
'action_name'
]).
to
eq
(
'commented on'
)
expect
(
comment_event
[
'project_id'
].
to_i
).
to
eq
(
project
.
id
)
expect
(
first_event
[
'project_id'
].
to_i
).
to
eq
(
project
.
id
)
expect
(
comment_event
[
'author_username'
]).
to
eq
(
user
.
username
)
expect
(
first_event
[
'author_username'
]).
to
eq
(
user
.
username
)
expect
(
comment_event
[
'note'
][
'id'
]).
to
eq
(
note
.
id
)
expect
(
first_event
[
'note'
][
'id'
]).
to
eq
(
note
.
id
)
expect
(
comment_event
[
'note'
][
'body'
]).
to
eq
(
'What an awesome day!'
)
expect
(
first_event
[
'note'
][
'body'
]).
to
eq
(
'What an awesome day!'
)
last_event
=
json_response
.
last
joined_event
=
json_response
.
find
{
|
e
|
e
[
'action_name'
]
==
'joined'
}
expect
(
last_event
[
'action_name'
]).
to
eq
(
'joined'
)
expect
(
joined_event
[
'project_id'
].
to_i
).
to
eq
(
project
.
id
)
expect
(
last_event
[
'project_id'
].
to_i
).
to
eq
(
project
.
id
)
expect
(
joined_event
[
'author_username'
]).
to
eq
(
user
.
username
)
expect
(
last_event
[
'author_username'
]).
to
eq
(
user
.
username
)
expect
(
joined_event
[
'author'
][
'name'
]).
to
eq
(
user
.
name
)
expect
(
last_event
[
'author'
][
'name'
]).
to
eq
(
user
.
name
)
end
end
end
end
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