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
011d0a4e
Commit
011d0a4e
authored
Mar 05, 2020
by
a_luna
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add more specs for WebIdeTerminalsController#retry
parent
b6afb8b5
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
9 deletions
+34
-9
ee/spec/controllers/projects/web_ide_terminals_controller_spec.rb
...controllers/projects/web_ide_terminals_controller_spec.rb
+34
-9
No files found.
ee/spec/controllers/projects/web_ide_terminals_controller_spec.rb
View file @
011d0a4e
...
@@ -3,13 +3,13 @@
...
@@ -3,13 +3,13 @@
require
'spec_helper'
require
'spec_helper'
describe
Projects
::
WebIdeTerminalsController
do
describe
Projects
::
WebIdeTerminalsController
do
let
(
:owner
)
{
create
(
:owner
)
}
let
_it_be
(
:owner
)
{
create
(
:owner
)
}
let
(
:admin
)
{
create
(
:admin
)
}
let
_it_be
(
:admin
)
{
create
(
:admin
)
}
let
(
:maintainer
)
{
create
(
:user
)
}
let
_it_be
(
:maintainer
)
{
create
(
:user
)
}
let
(
:developer
)
{
create
(
:user
)
}
let
_it_be
(
:developer
)
{
create
(
:user
)
}
let
(
:reporter
)
{
create
(
:user
)
}
let
_it_be
(
:reporter
)
{
create
(
:user
)
}
let
(
:guest
)
{
create
(
:user
)
}
let
_it_be
(
:guest
)
{
create
(
:user
)
}
let
(
:project
)
{
create
(
:project
,
:private
,
:repository
,
namespace:
owner
.
namespace
)
}
let
_it_be
(
:project
)
{
create
(
:project
,
:private
,
:repository
,
namespace:
owner
.
namespace
)
}
let
(
:pipeline
)
{
create
(
:ci_pipeline
,
project:
project
,
source: :webide
,
config_source: :webide_source
,
user:
user
)
}
let
(
:pipeline
)
{
create
(
:ci_pipeline
,
project:
project
,
source: :webide
,
config_source: :webide_source
,
user:
user
)
}
let
(
:job
)
{
create
(
:ci_build
,
pipeline:
pipeline
,
user:
user
,
project:
project
)
}
let
(
:job
)
{
create
(
:ci_build
,
pipeline:
pipeline
,
user:
user
,
project:
project
)
}
let
(
:user
)
{
maintainer
}
let
(
:user
)
{
maintainer
}
...
@@ -206,7 +206,8 @@ describe Projects::WebIdeTerminalsController do
...
@@ -206,7 +206,8 @@ describe Projects::WebIdeTerminalsController do
end
end
describe
'POST retry'
do
describe
'POST retry'
do
let
(
:job
)
{
create
(
:ci_build
,
:failed
,
pipeline:
pipeline
,
user:
user
,
project:
project
)
}
let
(
:status
)
{
:failed
}
let
(
:job
)
{
create
(
:ci_build
,
status
,
pipeline:
pipeline
,
user:
user
,
project:
project
)
}
before
do
before
do
post
(
:retry
,
params:
{
post
(
:retry
,
params:
{
...
@@ -220,11 +221,35 @@ describe Projects::WebIdeTerminalsController do
...
@@ -220,11 +221,35 @@ describe Projects::WebIdeTerminalsController do
it_behaves_like
'when pipeline is not from a webide source'
it_behaves_like
'when pipeline is not from a webide source'
context
'when job is not retryable'
do
context
'when job is not retryable'
do
let
!
(
:job
)
{
create
(
:ci_build
,
:running
,
pipeline:
pipeline
,
user:
user
)
}
let
(
:status
)
{
:running
}
it
'returns 422'
do
it
'returns 422'
do
expect
(
response
).
to
have_gitlab_http_status
(
:unprocessable_entity
)
expect
(
response
).
to
have_gitlab_http_status
(
:unprocessable_entity
)
end
end
end
end
context
'when job is cancelled'
do
let
(
:status
)
{
:canceled
}
it
'returns 200'
do
expect
(
response
).
to
have_gitlab_http_status
(
:ok
)
end
end
context
'when job fails'
do
let
(
:status
)
{
:failed
}
it
'returns 200'
do
expect
(
response
).
to
have_gitlab_http_status
(
:ok
)
end
end
context
'when job is successful'
do
let
(
:status
)
{
:success
}
it
'returns 200'
do
expect
(
response
).
to
have_gitlab_http_status
(
:ok
)
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