Commit 741f3fc2 authored by Tom Quirk's avatar Tom Quirk

Don't show integrations overrides tab at group lvl

Instance and group-level integrations pages share
the same haml templates, and there was a bu
where the instance-level overrides navigation tab
was displayed at the group-level.

This commit fixes that and adds a test.
parent bb2352cc
......@@ -128,7 +128,9 @@ module IntegrationsHelper
def integration_tabs(integration:)
[
{ key: 'edit', text: _('Settings'), href: scoped_edit_integration_path(integration) },
({ key: 'overrides', text: s_('Integrations|Projects using custom settings'), href: scoped_overrides_integration_path(integration) } if instance_level_integration_overrides?)
(
{ key: 'overrides', text: s_('Integrations|Projects using custom settings'), href: scoped_overrides_integration_path(integration) } if integration.instance_level? && instance_level_integration_overrides?
)
].compact
end
......
......@@ -13,4 +13,9 @@ RSpec.describe 'User activates the group-level Mattermost Slash Command integrat
let(:edit_path) { edit_group_settings_integration_path(group, :mattermost_slash_commands) }
include_examples 'user activates the Mattermost Slash Command integration'
it 'does not display the overrides tab' do
expect(page).not_to have_link('Settings', href: edit_path)
expect(page).not_to have_link('Projects using custom settings', href: overrides_admin_application_settings_integration_path(:mattermost_slash_commands))
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment