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
Boxiang Sun
gitlab-ce
Commits
5e66c656
Commit
5e66c656
authored
Jul 07, 2017
by
James Lopez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix specs
parent
377244dd
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
lib/api/users.rb
lib/api/users.rb
+1
-1
spec/requests/api/users_spec.rb
spec/requests/api/users_spec.rb
+3
-3
No files found.
lib/api/users.rb
View file @
5e66c656
...
@@ -57,7 +57,7 @@ module API
...
@@ -57,7 +57,7 @@ module API
get
do
get
do
authenticated_as_admin!
if
params
[
:external
].
present?
||
(
params
[
:extern_uid
].
present?
&&
params
[
:provider
].
present?
)
authenticated_as_admin!
if
params
[
:external
].
present?
||
(
params
[
:extern_uid
].
present?
&&
params
[
:provider
].
present?
)
unless
current_user
.
admin?
unless
current_user
&
.
admin?
params
.
except!
(
:created_after
,
:created_before
)
params
.
except!
(
:created_after
,
:created_before
)
end
end
...
...
spec/requests/api/users_spec.rb
View file @
5e66c656
...
@@ -165,7 +165,7 @@ describe API::Users do
...
@@ -165,7 +165,7 @@ describe API::Users do
end
end
it
"returns a user created before a specific date"
do
it
"returns a user created before a specific date"
do
user
=
create
(
:user
,
created_at:
Date
.
new
(
2000
,
1
,
1
))
user
=
create
(
:user
,
created_at:
Date
.
new
(
2000
,
1
,
1
))
get
api
(
"/users?created_before=2000-01-02T00:00:00.060Z"
,
admin
)
get
api
(
"/users?created_before=2000-01-02T00:00:00.060Z"
,
admin
)
...
@@ -175,7 +175,7 @@ describe API::Users do
...
@@ -175,7 +175,7 @@ describe API::Users do
end
end
it
"returns no users created before a specific date"
do
it
"returns no users created before a specific date"
do
create
(
:user
,
created_at:
Date
.
new
(
2001
,
1
,
1
))
create
(
:user
,
created_at:
Date
.
new
(
2001
,
1
,
1
))
get
api
(
"/users?created_before=2000-01-02T00:00:00.060Z"
,
admin
)
get
api
(
"/users?created_before=2000-01-02T00:00:00.060Z"
,
admin
)
...
@@ -184,7 +184,7 @@ describe API::Users do
...
@@ -184,7 +184,7 @@ describe API::Users do
end
end
it
"returns users created before and after a specific date"
do
it
"returns users created before and after a specific date"
do
user
=
create
(
:user
,
created_at:
Date
.
new
(
2001
,
1
,
1
))
user
=
create
(
:user
,
created_at:
Date
.
new
(
2001
,
1
,
1
))
get
api
(
"/users?created_before=2001-01-02T00:00:00.060Z&created_after=1999-01-02T00:00:00.060"
,
admin
)
get
api
(
"/users?created_before=2001-01-02T00:00:00.060Z&created_after=1999-01-02T00:00:00.060"
,
admin
)
...
...
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