Commit 81670094 authored by Sean McGivern's avatar Sean McGivern

Merge branch '52548-links-in-tabs-of-the-labels-index-pages-ends-with-html' into 'master'

Resolve "Links in tabs of the labels index pages ends with `.html`"

Closes #52548

See merge request gitlab-org/gitlab-ce!22716
parents 0ae4eb03 bd872bb8
...@@ -143,7 +143,7 @@ module LabelsHelper ...@@ -143,7 +143,7 @@ module LabelsHelper
def labels_filter_path(options = {}) def labels_filter_path(options = {})
project = @target_project || @project project = @target_project || @project
format = options.delete(:format) || :html format = options.delete(:format)
if project if project
project_labels_path(project, format, options) project_labels_path(project, format, options)
......
---
title: Fix bug when links in tabs of the labels index pages ends with .html
merge_request: 22716
author:
type: fixed
...@@ -211,4 +211,29 @@ describe LabelsHelper do ...@@ -211,4 +211,29 @@ describe LabelsHelper do
end end
end end
end end
describe 'labels_filter_path' do
let(:group) { create(:group) }
let(:project) { create(:project) }
it 'links to the dashboard labels page' do
expect(labels_filter_path).to eq(dashboard_labels_path)
end
it 'links to the group labels page' do
assign(:group, group)
expect(helper.labels_filter_path).to eq(group_labels_path(group))
end
it 'links to the project labels page' do
assign(:project, project)
expect(helper.labels_filter_path).to eq(project_labels_path(project))
end
it 'supports json format' do
expect(labels_filter_path(format: :json)).to eq(dashboard_labels_path(format: :json))
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