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
f676f388
Commit
f676f388
authored
Nov 06, 2017
by
Alessio Caiazza
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add more tests to Projects::Clusters::ApplicationsController
parent
2b4fccb7
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
8 deletions
+19
-8
app/controllers/projects/clusters/applications_controller.rb
app/controllers/projects/clusters/applications_controller.rb
+6
-8
spec/controllers/projects/clusters/applications_controller_spec.rb
...rollers/projects/clusters/applications_controller_spec.rb
+13
-0
No files found.
app/controllers/projects/clusters/applications_controller.rb
View file @
f676f388
...
...
@@ -5,15 +5,13 @@ class Projects::Clusters::ApplicationsController < Projects::ApplicationControll
before_action
:authorize_create_cluster!
,
only:
[
:create
]
def
create
scheduled
=
Clusters
::
Applications
::
ScheduleInstallationService
.
new
(
project
,
current_user
,
Clusters
::
Applications
::
ScheduleInstallationService
.
new
(
project
,
current_user
,
application_class:
@application_class
,
cluster:
@cluster
).
execute
if
scheduled
head
:no_content
else
rescue
StandardError
head
:bad_request
end
end
private
...
...
spec/controllers/projects/clusters/applications_controller_spec.rb
View file @
f676f388
...
...
@@ -49,6 +49,19 @@ describe Projects::Clusters::ApplicationsController do
expect
(
response
).
to
have_http_status
(
:not_found
)
end
end
context
'when application is already installing'
do
before
do
other
=
current_application
.
new
(
cluster:
cluster
)
other
.
make_installing!
end
it
'returns 400'
do
go
expect
(
response
).
to
have_http_status
(
:bad_request
)
end
end
end
describe
'security'
do
...
...
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