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
74a38a79
Commit
74a38a79
authored
Dec 14, 2021
by
Luke Duncalfe
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '289975-bugfix' into 'master'
Fix instance overrides page See merge request gitlab-org/gitlab!76624
parents
82451cf3
fd9bc67c
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
51 additions
and
37 deletions
+51
-37
app/views/shared/integrations/overrides.html.haml
app/views/shared/integrations/overrides.html.haml
+1
-1
spec/controllers/admin/integrations_controller_spec.rb
spec/controllers/admin/integrations_controller_spec.rb
+0
-36
spec/requests/admin/integrations_controller_spec.rb
spec/requests/admin/integrations_controller_spec.rb
+50
-0
No files found.
app/views/shared/integrations/overrides.html.haml
View file @
74a38a79
-
add_to_breadcrumbs
_
(
'Integrations'
),
scoped_integrations_path
(
project:
project
,
group:
group
)
-
add_to_breadcrumbs
_
(
'Integrations'
),
scoped_integrations_path
(
project:
@project
,
group:
@
group
)
-
breadcrumb_title
@integration
.
title
-
page_title
@integration
.
title
,
_
(
'Integrations'
)
-
@content_class
=
'limit-container-width'
unless
fluid_layout
...
...
spec/controllers/admin/integrations_controller_spec.rb
View file @
74a38a79
...
...
@@ -105,40 +105,4 @@ RSpec.describe Admin::IntegrationsController do
.
and
change
{
Integrations
::
Jira
.
inherit_from_id
(
integration
.
id
).
count
}.
by
(
-
1
)
end
end
describe
'#overrides'
do
let_it_be
(
:instance_integration
)
{
create
(
:bugzilla_integration
,
:instance
)
}
let_it_be
(
:non_overridden_integration
)
{
create
(
:bugzilla_integration
,
inherit_from_id:
instance_integration
.
id
)
}
let_it_be
(
:overridden_integration
)
{
create
(
:bugzilla_integration
)
}
let_it_be
(
:overridden_other_integration
)
{
create
(
:confluence_integration
)
}
subject
do
get
:overrides
,
params:
{
id:
instance_integration
.
class
.
to_param
},
format:
format
end
context
'when format is JSON'
do
let
(
:format
)
{
:json
}
include_context
'JSON response'
it
'returns projects with overrides'
,
:aggregate_failures
do
subject
expect
(
response
).
to
have_gitlab_http_status
(
:ok
)
expect
(
response
).
to
include_pagination_headers
expect
(
json_response
).
to
contain_exactly
(
a_hash_including
(
'full_name'
=>
overridden_integration
.
project
.
full_name
))
end
end
context
'when format is HTML'
do
let
(
:format
)
{
:html
}
it
'renders template'
do
subject
expect
(
response
).
to
render_template
'shared/integrations/overrides'
expect
(
assigns
(
:integration
)).
to
eq
(
instance_integration
)
end
end
end
end
spec/requests/admin/integrations_controller_spec.rb
0 → 100644
View file @
74a38a79
# frozen_string_literal: true
require
'spec_helper'
RSpec
.
describe
Admin
::
IntegrationsController
,
:enable_admin_mode
do
let_it_be
(
:admin
)
{
create
(
:admin
)
}
before
do
sign_in
(
admin
)
end
describe
'GET #overrides'
do
let_it_be
(
:integration
)
{
create
(
:jira_integration
,
:instance
)
}
let_it_be
(
:overridden_integration
)
{
create
(
:jira_integration
)
}
let_it_be
(
:overridden_other_integration
)
{
create
(
:confluence_integration
)
}
let
(
:overrides_path
)
{
overrides_admin_application_settings_integration_path
(
integration
,
format:
format
)
}
context
'format html'
do
let
(
:format
)
{
:html
}
it
'renders'
do
get
overrides_path
expect
(
response
).
to
have_gitlab_http_status
(
:ok
)
expect
(
response
).
to
render_template
(
'shared/integrations/overrides'
)
end
end
context
'format json'
do
let
(
:format
)
{
:json
}
let
(
:project
)
{
overridden_integration
.
project
}
it
'returns the project overrides data'
do
get
overrides_path
expect
(
response
).
to
have_gitlab_http_status
(
:ok
)
expect
(
response
).
to
include_pagination_headers
expect
(
json_response
).
to
contain_exactly
(
{
'avatar_url'
=>
project
.
avatar_url
,
'full_name'
=>
project
.
full_name
,
'name'
=>
project
.
name
,
'full_path'
=>
project_path
(
project
)
}
)
end
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