Commit 0ec2eff3 authored by Nick Thomas's avatar Nick Thomas

Merge branch '214230-create-epics-from-the-new-menu' into 'master'

Add "New epic" item to "New (+)" dropdown

See merge request gitlab-org/gitlab!34120
parents a9895a77 1ec3fe93
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
%li= link_to _('New project'), new_project_path(namespace_id: @group.id) %li= link_to _('New project'), new_project_path(namespace_id: @group.id)
- if create_group_subgroup - if create_group_subgroup
%li= link_to _('New subgroup'), new_group_path(parent_id: @group.id) %li= link_to _('New subgroup'), new_group_path(parent_id: @group.id)
= render_if_exists 'layouts/header/create_epic_new_dropdown_item'
%li.divider %li.divider
%li.dropdown-bold-header GitLab %li.dropdown-bold-header GitLab
......
- create_group_epic = can?(current_user, :create_epic, @group)
- return unless create_group_epic && Feature.enabled?(:create_epic_form)
%li= link_to _('New epic'), new_group_epic_path(@group)
# frozen_string_literal: true
require 'spec_helper'
describe 'layouts/header/_new_dropdown' do
let(:user) { create(:user) }
context 'group-specific links' do
let(:group) { create(:group) }
before do
allow(view).to receive(:current_user).and_return(user)
assign(:group, group)
end
it 'does not have "New epic" link' do
render
expect(rendered).not_to have_link(
'New epic',
href: new_group_epic_path(group)
)
end
context 'as a Group owner' do
before do
group.add_owner(user)
end
context 'with the epics license' do
before do
stub_licensed_features(epics: true)
end
it 'has a "New epic" link' do
render
expect(rendered).to have_link(
'New epic',
href: new_group_epic_path(group)
)
end
context 'with the create_epic_form feature flag disabled' do
before do
stub_feature_flags(create_epic_form: false)
end
it 'does not have "New epic" link' do
render
expect(rendered).not_to have_link(
'New epic',
href: new_group_epic_path(group)
)
end
end
end
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