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
a7fbae5f
Commit
a7fbae5f
authored
Jul 18, 2017
by
Stan Hu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add spec for GeoNodesController
parent
ed56d9ba
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
0 deletions
+31
-0
spec/controllers/admin/geo_nodes_controller_spec.rb
spec/controllers/admin/geo_nodes_controller_spec.rb
+31
-0
No files found.
spec/controllers/admin/geo_nodes_controller_spec.rb
View file @
a7fbae5f
...
...
@@ -104,6 +104,37 @@ describe Admin::GeoNodesController, :postgresql do
end
end
describe
'#update'
do
let
(
:geo_node_attributes
)
{
{
url:
'http://example.com'
,
geo_node_key_attributes:
{
key:
SSHKeygen
.
generate
}
}
}
let
(
:geo_node
)
{
create
(
:geo_node
)
}
subject
{
post
:update
,
id:
geo_node
,
geo_node:
geo_node_attributes
}
context
'without add-on license'
do
before
do
allow
(
Gitlab
::
Geo
).
to
receive
(
:license_allows?
)
{
false
}
subject
end
it_behaves_like
'unlicensed geo action'
end
context
'with add-on license'
do
before
do
allow
(
Gitlab
::
Geo
).
to
receive
(
:license_allows?
).
and_return
(
true
)
subject
end
it
'updates the node without changing the key'
do
original_fingerprint
=
geo_node
.
geo_node_key
.
fingerprint
geo_node
.
reload
expect
(
geo_node
.
url
.
chomp
(
'/'
)).
to
eq
(
geo_node_attributes
[
:url
])
expect
(
geo_node
.
geo_node_key
.
fingerprint
).
to
eq
(
original_fingerprint
)
end
end
end
describe
'#repair'
do
let
(
:geo_node
)
{
create
(
:geo_node
)
}
subject
{
post
:repair
,
id:
geo_node
}
...
...
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