summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/views/layouts/nav/_project.html.haml2
-rw-r--r--app/views/projects/issues/_head.html.haml4
-rw-r--r--features/project/active_tab.feature12
-rw-r--r--features/steps/project/active_tab.rb16
-rw-r--r--features/steps/shared/active_tab.rb4
5 files changed, 21 insertions, 17 deletions
diff --git a/app/views/layouts/nav/_project.html.haml b/app/views/layouts/nav/_project.html.haml
index 9dc76fce9e1..79cc5c02888 100644
--- a/app/views/layouts/nav/_project.html.haml
+++ b/app/views/layouts/nav/_project.html.haml
@@ -63,7 +63,7 @@
Graphs
- if project_nav_tab? :issues
- = nav_link(controller: :issues) do
+ = nav_link(controller: [:issues, :labels, :milestones]) do
= link_to url_for_project_issues(@project, only_path: true), title: 'Issues', class: 'shortcuts-issues' do
= navbar_icon('issues')
%span
diff --git a/app/views/projects/issues/_head.html.haml b/app/views/projects/issues/_head.html.haml
index d0481be9932..583cc1b975b 100644
--- a/app/views/projects/issues/_head.html.haml
+++ b/app/views/projects/issues/_head.html.haml
@@ -1,12 +1,12 @@
%ul.nav-links.sub-nav
%div{ class: (container_class) }
- - if project_nav_tab?(:issues)
+ - if project_nav_tab?(:issues) && current_controller?(:issues)
= nav_link(controller: :issues) do
= link_to url_for_project_issues(@project, only_path: true), title: 'Issues' do
%span
Issues
- - if project_nav_tab?(:merge_requests)
+ - if project_nav_tab?(:merge_requests) && current_controller?(:merge_requests)
= nav_link(controller: :merge_requests) do
= link_to namespace_project_merge_requests_path(@project.namespace, @project), title: 'Merge Requests' do
%span
diff --git a/features/project/active_tab.feature b/features/project/active_tab.feature
index 26e67503021..c4f987a7923 100644
--- a/features/project/active_tab.feature
+++ b/features/project/active_tab.feature
@@ -107,12 +107,16 @@ Feature: Project Active Tab
Scenario: On Project Issues/Milestones
Given I visit my project's issues page
- And I click the "Milestones" tab
- Then the active main tab should be Milestones
+ And I click the "Milestones" sub tab
+ Then the active main tab should be Issues
+ Then the active sub tab should be Milestones
And no other main tabs should be active
+ And no other sub tabs should be active
Scenario: On Project Issues/Labels
Given I visit my project's issues page
- And I click the "Labels" tab
- Then the active main tab should be Labels
+ And I click the "Labels" sub tab
+ Then the active main tab should be Issues
+ Then the active sub tab should be Labels
And no other main tabs should be active
+ And no other sub tabs should be active
diff --git a/features/steps/project/active_tab.rb b/features/steps/project/active_tab.rb
index 745fd3471c4..80043463188 100644
--- a/features/steps/project/active_tab.rb
+++ b/features/steps/project/active_tab.rb
@@ -77,14 +77,14 @@ class Spinach::Features::ProjectActiveTab < Spinach::FeatureSteps
# Sub Tabs: Issues
- step 'I click the "Milestones" tab' do
- page.within('.layout-nav') do
+ step 'I click the "Milestones" sub tab' do
+ page.within('.sub-nav') do
click_link('Milestones')
end
end
- step 'I click the "Labels" tab' do
- page.within('.layout-nav') do
+ step 'I click the "Labels" sub tab' do
+ page.within('.sub-nav') do
click_link('Labels')
end
end
@@ -93,11 +93,11 @@ class Spinach::Features::ProjectActiveTab < Spinach::FeatureSteps
ensure_active_sub_tab('Issues')
end
- step 'the active main tab should be Milestones' do
- ensure_active_main_tab('Milestones')
+ step 'the active sub tab should be Milestones' do
+ ensure_active_sub_tab('Milestones')
end
- step 'the active main tab should be Labels' do
- ensure_active_main_tab('Labels')
+ step 'the active sub tab should be Labels' do
+ ensure_active_sub_tab('Labels')
end
end
diff --git a/features/steps/shared/active_tab.rb b/features/steps/shared/active_tab.rb
index ace717b9909..4eef7aff213 100644
--- a/features/steps/shared/active_tab.rb
+++ b/features/steps/shared/active_tab.rb
@@ -6,7 +6,7 @@ module SharedActiveTab
end
def ensure_active_sub_tab(content)
- expect(find('div.content ul.nav-links li.active')).to have_content(content)
+ expect(find('.sub-nav li.active')).to have_content(content)
end
def ensure_active_sub_nav(content)
@@ -18,7 +18,7 @@ module SharedActiveTab
end
step 'no other sub tabs should be active' do
- expect(page).to have_selector('div.content ul.nav-links li.active', count: 1)
+ expect(page).to have_selector('.sub-nav li.active', count: 1)
end
step 'no other sub navs should be active' do