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
b3b89ec0
Commit
b3b89ec0
authored
Nov 30, 2017
by
James Lopez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add a bunch more of specs
parent
33955934
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
54 additions
and
0 deletions
+54
-0
spec/requests/api/geo_nodes_spec.rb
spec/requests/api/geo_nodes_spec.rb
+54
-0
No files found.
spec/requests/api/geo_nodes_spec.rb
View file @
b3b89ec0
...
@@ -101,6 +101,60 @@ describe API::GeoNodes, :geo, api: true do
...
@@ -101,6 +101,60 @@ describe API::GeoNodes, :geo, api: true do
expect
(
response
).
to
match_response_schema
(
'geo_project_registry'
)
expect
(
response
).
to
match_response_schema
(
'geo_project_registry'
)
end
end
it
'does not show any registry when there is no failure'
do
create
(
:geo_project_registry
,
:synced
)
stub_current_geo_node
(
secondary
)
expect
(
GeoNode
).
to
receive
(
:find
).
and_return
(
secondary
)
get
api
(
"/geo_nodes/
#{
secondary
.
id
}
/failures"
,
admin
)
expect
(
response
.
status
).
to
eq
200
expect
(
json_response
.
count
).
to
be_zero
end
context
'wiki type'
do
it
'only shows wiki failures'
do
create
(
:geo_project_registry
,
:wiki_sync_failed
)
create
(
:geo_project_registry
,
:repository_sync_failed
)
stub_current_geo_node
(
secondary
)
expect
(
GeoNode
).
to
receive
(
:find
).
and_return
(
secondary
)
get
api
(
"/geo_nodes/
#{
secondary
.
id
}
/failures?type=wiki"
,
admin
)
expect
(
response
.
status
).
to
eq
200
expect
(
json_response
.
count
).
to
eq
(
1
)
expect
(
json_response
.
first
[
'wiki_retry_count'
]).
to
be
>
0
end
end
context
'repository type'
do
it
'only shows repository failures'
do
create
(
:geo_project_registry
,
:wiki_sync_failed
)
create
(
:geo_project_registry
,
:repository_sync_failed
)
stub_current_geo_node
(
secondary
)
expect
(
GeoNode
).
to
receive
(
:find
).
and_return
(
secondary
)
get
api
(
"/geo_nodes/
#{
secondary
.
id
}
/failures?type=repository"
,
admin
)
expect
(
response
.
status
).
to
eq
200
expect
(
json_response
.
count
).
to
eq
(
1
)
expect
(
json_response
.
first
[
'repository_retry_count'
]).
to
be
>
0
end
end
context
'nonexistent type'
do
it
'returns a bad request'
do
create
(
:geo_project_registry
,
:repository_sync_failed
)
get
api
(
"/geo_nodes/
#{
secondary
.
id
}
/failures?type=nonexistent"
,
admin
)
expect
(
response
.
status
).
to
eq
400
end
end
it
'denies access if not admin'
do
it
'denies access if not admin'
do
get
api
(
"/geo_nodes/
#{
secondary
.
id
}
/failures"
,
user
)
get
api
(
"/geo_nodes/
#{
secondary
.
id
}
/failures"
,
user
)
...
...
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