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
fdc23a93
Commit
fdc23a93
authored
Sep 09, 2013
by
Izaak Alpert
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Style guide fixes (spacing)
Change-Id: I966bfd0ccc4b05925384ecab8c6cbe3c6ba3b667
parent
7a56075e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
spec/requests/api/api_helpers_spec.rb
spec/requests/api/api_helpers_spec.rb
+4
-2
No files found.
spec/requests/api/api_helpers_spec.rb
View file @
fdc23a93
...
@@ -17,7 +17,6 @@ describe API do
...
@@ -17,7 +17,6 @@ describe API do
env
[
API
::
APIHelpers
::
SUDO_HEADER
]
=
identifier
env
[
API
::
APIHelpers
::
SUDO_HEADER
]
=
identifier
end
end
def
set_param
(
token_usr
,
identifier
)
def
set_param
(
token_usr
,
identifier
)
clear_env
clear_env
clear_param
clear_param
...
@@ -25,7 +24,6 @@ describe API do
...
@@ -25,7 +24,6 @@ describe API do
params
[
API
::
APIHelpers
::
SUDO_PARAM
]
=
identifier
params
[
API
::
APIHelpers
::
SUDO_PARAM
]
=
identifier
end
end
def
clear_env
def
clear_env
env
.
delete
(
API
::
APIHelpers
::
PRIVATE_TOKEN_HEADER
)
env
.
delete
(
API
::
APIHelpers
::
PRIVATE_TOKEN_HEADER
)
env
.
delete
(
API
::
APIHelpers
::
SUDO_HEADER
)
env
.
delete
(
API
::
APIHelpers
::
SUDO_HEADER
)
...
@@ -70,6 +68,7 @@ describe API do
...
@@ -70,6 +68,7 @@ describe API do
set_param
(
user
,
admin
.
username
)
set_param
(
user
,
admin
.
username
)
expect
{
current_user
}.
to
raise_error
expect
{
current_user
}.
to
raise_error
end
end
it
"should throw an error when the user cannot be found for a given id"
do
it
"should throw an error when the user cannot be found for a given id"
do
id
=
user
.
id
+
admin
.
id
id
=
user
.
id
+
admin
.
id
user
.
id
.
should_not
==
id
user
.
id
.
should_not
==
id
...
@@ -80,6 +79,7 @@ describe API do
...
@@ -80,6 +79,7 @@ describe API do
set_param
(
admin
,
id
)
set_param
(
admin
,
id
)
expect
{
current_user
}.
to
raise_error
expect
{
current_user
}.
to
raise_error
end
end
it
"should throw an error when the user cannot be found for a given username"
do
it
"should throw an error when the user cannot be found for a given username"
do
username
=
"
#{
user
.
username
}#{
admin
.
username
}
"
username
=
"
#{
user
.
username
}#{
admin
.
username
}
"
user
.
username
.
should_not
==
username
user
.
username
.
should_not
==
username
...
@@ -90,6 +90,7 @@ describe API do
...
@@ -90,6 +90,7 @@ describe API do
set_param
(
admin
,
username
)
set_param
(
admin
,
username
)
expect
{
current_user
}.
to
raise_error
expect
{
current_user
}.
to
raise_error
end
end
it
"should handle sudo's to oneself"
do
it
"should handle sudo's to oneself"
do
set_env
(
admin
,
admin
.
id
)
set_env
(
admin
,
admin
.
id
)
current_user
.
should
==
admin
current_user
.
should
==
admin
...
@@ -116,6 +117,7 @@ describe API do
...
@@ -116,6 +117,7 @@ describe API do
current_user
.
should
==
user
current_user
.
should
==
user
current_user
.
should
==
user
current_user
.
should
==
user
end
end
it
"should handle multiple sudo's to oneself using string ids"
do
it
"should handle multiple sudo's to oneself using string ids"
do
set_env
(
admin
,
user
.
id
.
to_s
)
set_env
(
admin
,
user
.
id
.
to_s
)
current_user
.
should
==
user
current_user
.
should
==
user
...
...
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