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
61f04311
Commit
61f04311
authored
Dec 19, 2016
by
Gabriel Mazetto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Codestyle changes
parent
6b934d7f
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
23 additions
and
11 deletions
+23
-11
app/views/admin/geo_nodes/_form.html.haml
app/views/admin/geo_nodes/_form.html.haml
+4
-4
app/views/admin/geo_nodes/index.html.haml
app/views/admin/geo_nodes/index.html.haml
+1
-1
spec/controllers/admin/geo_nodes_controller_spec.rb
spec/controllers/admin/geo_nodes_controller_spec.rb
+18
-6
spec/support/ssh_keygen.rb
spec/support/ssh_keygen.rb
+0
-0
No files found.
app/views/admin/geo_nodes/_form.html.haml
View file @
61f04311
=
form_for
@
node
,
as: :geo_node
,
url:
admin_geo_nodes_path
,
html:
{
class:
'form-horizontal'
}
do
|
f
|
-
if
@
node
.
errors
.
any?
=
form_for
geo_
node
,
as: :geo_node
,
url:
admin_geo_nodes_path
,
html:
{
class:
'form-horizontal'
}
do
|
f
|
-
if
geo_
node
.
errors
.
any?
.alert.alert-danger
-
@
node
.
errors
.
full_messages
.
each
do
|
msg
|
-
geo_
node
.
errors
.
full_messages
.
each
do
|
msg
|
%p
=
msg
.form-group
.col-sm-offset-2.col-sm-10
...
...
@@ -13,7 +13,7 @@
=
f
.
label
:url
,
'URL'
,
class:
'control-label'
.col-sm-10
=
f
.
text_field
:url
,
class:
'form-control'
=
f
.
fields_for
:geo_node_key
,
@
node
.
geo_node_key
do
|
fg
|
=
f
.
fields_for
:geo_node_key
,
geo_
node
.
geo_node_key
do
|
fg
|
.form-group
=
fg
.
label
:key
,
'Public Key'
,
class:
'control-label'
.col-sm-10
...
...
app/views/admin/geo_nodes/index.html.haml
View file @
61f04311
...
...
@@ -8,7 +8,7 @@
%hr
=
render
:partial
=>
'form'
if
Gitlab
::
Geo
.
license_allows?
=
render
:partial
=>
'form'
,
locals:
{
geo_node:
@node
}
if
Gitlab
::
Geo
.
license_allows?
-
if
@nodes
.
any?
.panel.panel-default
...
...
spec/controllers/admin/geo_nodes_controller_spec.rb
View file @
61f04311
...
...
@@ -23,7 +23,9 @@ describe Admin::GeoNodesController do
subject
{
get
:index
}
context
'with add-on license available'
do
before
{
allow
(
Gitlab
::
Geo
).
to
receive
(
:license_allows?
).
and_return
(
true
)
}
before
do
allow
(
Gitlab
::
Geo
).
to
receive
(
:license_allows?
).
and_return
(
true
)
end
it
'renders creation form'
do
expect
(
subject
).
to
render_template
(
partial:
'admin/geo_nodes/_form'
)
...
...
@@ -31,7 +33,9 @@ describe Admin::GeoNodesController do
end
context
'without add-on license available'
do
before
{
allow
(
Gitlab
::
Geo
).
to
receive
(
:license_allows?
).
and_return
(
false
)
}
before
do
allow
(
Gitlab
::
Geo
).
to
receive
(
:license_allows?
).
and_return
(
false
)
end
it
'does not render the creation form'
do
expect
(
subject
).
not_to
render_template
(
partial:
'admin/geo_nodes/_form'
)
...
...
@@ -51,10 +55,14 @@ describe Admin::GeoNodesController do
describe
'#destroy'
do
let!
(
:geo_node
)
{
create
(
:geo_node
)
}
subject
{
delete
(
:destroy
,
id:
geo_node
)
}
subject
do
delete
(
:destroy
,
id:
geo_node
)
end
context
'without add-on license'
do
before
{
allow
(
Gitlab
::
Geo
).
to
receive
(
:license_allows?
).
and_return
(
false
)
}
before
do
allow
(
Gitlab
::
Geo
).
to
receive
(
:license_allows?
).
and_return
(
false
)
end
it
'deletes the node'
do
expect
{
subject
}.
to
change
{
GeoNode
.
count
}.
by
(
-
1
)
...
...
@@ -62,7 +70,9 @@ describe Admin::GeoNodesController do
end
context
'with add-on license'
do
before
{
allow
(
Gitlab
::
Geo
).
to
receive
(
:license_allows?
).
and_return
(
true
)
}
before
do
allow
(
Gitlab
::
Geo
).
to
receive
(
:license_allows?
).
and_return
(
true
)
end
it
'deletes the node'
do
expect
{
subject
}.
to
change
{
GeoNode
.
count
}.
by
(
-
1
)
...
...
@@ -84,7 +94,9 @@ describe Admin::GeoNodesController do
end
context
'with add-on license'
do
before
{
allow
(
Gitlab
::
Geo
).
to
receive
(
:license_allows?
).
and_return
(
true
)
}
before
do
allow
(
Gitlab
::
Geo
).
to
receive
(
:license_allows?
).
and_return
(
true
)
end
it
'creates the node'
do
expect
{
subject
}.
to
change
{
GeoNode
.
count
}.
by
(
1
)
...
...
spec/support/
openssh_key
.rb
→
spec/support/
ssh_keygen
.rb
View file @
61f04311
File moved
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