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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
16b3368a
Commit
16b3368a
authored
Feb 02, 2016
by
Tomasz Maczukin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix runners API spec
parent
81ced6f5
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
11 deletions
+11
-11
spec/requests/api/runners_spec.rb
spec/requests/api/runners_spec.rb
+11
-11
No files found.
spec/requests/api/runners_spec.rb
View file @
16b3368a
...
...
@@ -316,24 +316,24 @@ describe API::API, api: true do
end
end
describe
'P
U
T /projects/:id/runners/:runner_id'
do
describe
'P
OS
T /projects/:id/runners/:runner_id'
do
context
'authorized user'
do
it
'should enable specific runner'
do
expect
do
p
u
t
api
(
"/projects/
#{
project
.
id
}
/runners/
#{
specific_runner2
.
id
}
"
,
user
)
p
os
t
api
(
"/projects/
#{
project
.
id
}
/runners/
#{
specific_runner2
.
id
}
"
,
user
)
end
.
to
change
{
project
.
runners
.
count
}.
by
(
+
1
)
expect
(
response
.
status
).
to
eq
(
20
0
)
expect
(
response
.
status
).
to
eq
(
20
1
)
end
it
'should avoid changes when enabling already enabled runner'
do
expect
do
p
u
t
api
(
"/projects/
#{
project
.
id
}
/runners/
#{
specific_runner
.
id
}
"
,
user
)
p
os
t
api
(
"/projects/
#{
project
.
id
}
/runners/
#{
specific_runner
.
id
}
"
,
user
)
end
.
to
change
{
project
.
runners
.
count
}.
by
(
0
)
expect
(
response
.
status
).
to
eq
(
20
0
)
expect
(
response
.
status
).
to
eq
(
20
1
)
end
it
'should not enable shared runner'
do
p
u
t
api
(
"/projects/
#{
project
.
id
}
/runners/
#{
shared_runner
.
id
}
"
,
user
)
p
os
t
api
(
"/projects/
#{
project
.
id
}
/runners/
#{
shared_runner
.
id
}
"
,
user
)
expect
(
response
.
status
).
to
eq
(
403
)
end
...
...
@@ -341,15 +341,15 @@ describe API::API, api: true do
context
'user is admin'
do
it
'should enable any specific runner'
do
expect
do
p
u
t
api
(
"/projects/
#{
project
.
id
}
/runners/
#{
unused_specific_runner
.
id
}
"
,
admin
)
p
os
t
api
(
"/projects/
#{
project
.
id
}
/runners/
#{
unused_specific_runner
.
id
}
"
,
admin
)
end
.
to
change
{
project
.
runners
.
count
}.
by
(
+
1
)
expect
(
response
.
status
).
to
eq
(
20
0
)
expect
(
response
.
status
).
to
eq
(
20
1
)
end
end
context
'user is not admin'
do
it
'should not enable runner without access to'
do
p
u
t
api
(
"/projects/
#{
project
.
id
}
/runners/
#{
unused_specific_runner
.
id
}
"
,
user
)
p
os
t
api
(
"/projects/
#{
project
.
id
}
/runners/
#{
unused_specific_runner
.
id
}
"
,
user
)
expect
(
response
.
status
).
to
eq
(
403
)
end
...
...
@@ -358,7 +358,7 @@ describe API::API, api: true do
context
'authorized user without permissions'
do
it
'should not enable runner'
do
p
u
t
api
(
"/projects/
#{
project
.
id
}
/runners/
#{
specific_runner2
.
id
}
"
,
user2
)
p
os
t
api
(
"/projects/
#{
project
.
id
}
/runners/
#{
specific_runner2
.
id
}
"
,
user2
)
expect
(
response
.
status
).
to
eq
(
403
)
end
...
...
@@ -366,7 +366,7 @@ describe API::API, api: true do
context
'unauthorized user'
do
it
'should not enable runner'
do
p
u
t
api
(
"/projects/
#{
project
.
id
}
/runners/
#{
specific_runner2
.
id
}
"
)
p
os
t
api
(
"/projects/
#{
project
.
id
}
/runners/
#{
specific_runner2
.
id
}
"
)
expect
(
response
.
status
).
to
eq
(
401
)
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