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
cc77c0e6
Commit
cc77c0e6
authored
Jul 18, 2017
by
Stan Hu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add spec for adding/editing/removing Geo Nodes
parent
a7fbae5f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
76 additions
and
0 deletions
+76
-0
spec/features/admin/admin_geo_nodes_spec.rb
spec/features/admin/admin_geo_nodes_spec.rb
+76
-0
No files found.
spec/features/admin/admin_geo_nodes_spec.rb
0 → 100644
View file @
cc77c0e6
require
'spec_helper'
RSpec
.
describe
'admin Geo Nodes'
,
type: :feature
do
let!
(
:geo_node
)
{
create
(
:geo_node
)
}
before
do
allow
(
Gitlab
::
Geo
).
to
receive
(
:license_allows?
).
and_return
(
true
)
sign_in
(
create
(
:admin
))
end
it
'show all public Geo Nodes'
do
visit
admin_geo_nodes_path
page
.
within
(
find
(
'.geo-nodes'
,
match: :first
))
do
expect
(
page
).
to
have_content
(
geo_node
.
url
)
end
end
describe
'create a new Geo Nodes'
do
let
(
:new_ssh_key
)
{
attributes_for
(
:key
)[
:key
]
}
before
do
visit
admin_geo_nodes_path
end
it
'creates a new Geo Node'
do
check
'This is a primary node'
fill_in
'geo_node_url'
,
with:
'https://test.gitlab.com'
fill_in
'geo_node_geo_node_key_attributes_key'
,
with:
new_ssh_key
click_button
'Add Node'
expect
(
current_path
).
to
eq
admin_geo_nodes_path
page
.
within
(
find
(
'.geo-nodes'
,
match: :first
))
do
expect
(
page
).
to
have_content
(
geo_node
.
url
)
end
end
end
describe
'update an existing Geo Node'
do
before
do
visit
admin_geo_nodes_path
page
.
within
(
find
(
'.node-actions'
,
match: :first
))
do
page
.
click_link
(
'Edit'
)
end
end
it
'updates an existing Geo Node'
do
fill_in
'URL'
,
with:
'http://newsite.com'
check
'This is a primary node'
click_button
'Save changes'
expect
(
current_path
).
to
eq
admin_geo_nodes_path
page
.
within
(
find
(
'.geo-nodes'
,
match: :first
))
do
expect
(
page
).
to
have_content
(
'http://newsite.com'
)
expect
(
page
).
to
have_content
(
'Primary'
)
end
end
end
describe
'remove an existing Geo Node'
do
before
do
visit
admin_geo_nodes_path
end
it
'removes an existing Geo Node'
do
page
.
within
(
find
(
'.node-actions'
,
match: :first
))
do
page
.
click_link
(
'Remove'
)
end
expect
(
current_path
).
to
eq
admin_geo_nodes_path
expect
(
page
).
not_to
have_css
(
'.geo-nodes'
)
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