Commit 42041bdb authored by Sri's avatar Sri

Improve `Project :: Infra :: Google Cloud` Menu

The project :: infra :: google cloud menu item:

- Needs to be tested the same way other in that grouping
  (kubernetes, serverless, terraform) are tested
- Active routes controller needs to be defined
parent 275af535
......@@ -100,7 +100,7 @@ module Sidebars
::Sidebars::MenuItem.new(
title: _('Google Cloud'),
link: project_google_cloud_index_path(context.project),
active_routes: {},
active_routes: { controller: :google_cloud },
item_id: :google_cloud
)
end
......
......@@ -51,6 +51,16 @@ RSpec.describe Sidebars::Projects::Menus::InfrastructureMenu do
it 'menu link points to Terraform page' do
expect(subject.link).to eq find_menu_item(:terraform).link
end
context 'when Terraform menu is not visible' do
before do
subject.renderable_items.delete(find_menu_item(:terraform))
end
it 'menu link points to Google Cloud page' do
expect(subject.link).to eq find_menu_item(:google_cloud).link
end
end
end
end
......@@ -89,5 +99,11 @@ RSpec.describe Sidebars::Projects::Menus::InfrastructureMenu do
it_behaves_like 'access rights checks'
end
describe 'Google Cloud' do
let(:item_id) { :google_cloud }
it_behaves_like 'access rights checks'
end
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