Commit 6f115937 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Fix bug when links in tabs of the labels index pages ends with .html

Signed-off-by: default avatarDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
parent 11611708
...@@ -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 group 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