Fix bug when links in tabs of the labels index pages ends with .html
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
This commit is contained in:
parent
116117084c
commit
6f11593774
3 changed files with 31 additions and 1 deletions
|
@ -143,7 +143,7 @@ module LabelsHelper
|
|||
|
||||
def labels_filter_path(options = {})
|
||||
project = @target_project || @project
|
||||
format = options.delete(:format) || :html
|
||||
format = options.delete(:format)
|
||||
|
||||
if project
|
||||
project_labels_path(project, format, options)
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
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
|
|||
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
|
||||
|
|
Loading…
Reference in a new issue