2021-09-04 01:27:46 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
require 'spec_helper'
|
|
|
|
|
2023-05-27 22:25:52 +05:30
|
|
|
RSpec.describe Sidebars::Projects::Menus::ScopeMenu, feature_category: :navigation do
|
2021-09-04 01:27:46 +05:30
|
|
|
let(:project) { build(:project) }
|
2022-04-04 11:22:00 +05:30
|
|
|
let(:user) { project.first_owner }
|
2021-09-04 01:27:46 +05:30
|
|
|
let(:context) { Sidebars::Projects::Context.new(current_user: user, container: project) }
|
|
|
|
|
2023-05-27 22:25:52 +05:30
|
|
|
it_behaves_like 'serializable as super_sidebar_menu_args' do
|
|
|
|
let(:menu) { described_class.new(context) }
|
|
|
|
let(:extra_attrs) do
|
|
|
|
{
|
|
|
|
title: _('Project overview'),
|
|
|
|
sprite_icon: 'project',
|
|
|
|
super_sidebar_parent: ::Sidebars::StaticMenu,
|
|
|
|
item_id: :project_overview
|
|
|
|
}
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2021-09-04 01:27:46 +05:30
|
|
|
describe '#container_html_options' do
|
|
|
|
subject { described_class.new(context).container_html_options }
|
|
|
|
|
|
|
|
specify { is_expected.to match(hash_including(class: 'shortcuts-project rspec-project-link')) }
|
|
|
|
end
|
2021-11-18 22:05:49 +05:30
|
|
|
|
|
|
|
describe '#extra_nav_link_html_options' do
|
|
|
|
subject { described_class.new(context).extra_nav_link_html_options }
|
|
|
|
|
|
|
|
specify { is_expected.to match(hash_including(class: 'context-header has-tooltip', title: context.project.name)) }
|
|
|
|
end
|
2021-09-04 01:27:46 +05:30
|
|
|
end
|