提交 483b5f1b 编写于 作者: S Sean McGivern

Merge branch '39364-in-issue-board-url-doesn-t-take-in-account-hostname-settings' into 'master'

Resolve "In Issue board url doesn't take in account hostname settings"

Closes #39364

See merge request gitlab-org/gitlab-ce!15703
......@@ -20,7 +20,7 @@ class Projects::BoardsController < Projects::ApplicationController
private
def assign_endpoint_vars
@boards_endpoint = project_boards_url(project)
@boards_endpoint = project_boards_path(project)
@bulk_issues_path = bulk_update_project_issues_path(project)
@namespace_path = project.namespace.full_path
@labels_endpoint = project_labels_path(project)
......
......@@ -6,7 +6,7 @@ module BoardsHelper
def board_data
{
boards_endpoint: @boards_endpoint,
lists_endpoint: board_lists_url(board),
lists_endpoint: board_lists_path(board),
board_id: board.id,
disabled: "#{!can?(current_user, :admin_list, current_board_parent)}",
issue_link_base: build_issue_link_base,
......
---
title: Change boards page boards_data absolute urls to paths
merge_request: 15703
author:
type: fixed
......@@ -14,6 +14,12 @@ describe Projects::BoardsController do
expect { list_boards }.to change(project.boards, :count).by(1)
end
it 'sets boards_endpoint instance variable to a boards path' do
list_boards
expect(assigns(:boards_endpoint)).to eq project_boards_path(project)
end
context 'when format is HTML' do
it 'renders template' do
list_boards
......@@ -59,6 +65,12 @@ describe Projects::BoardsController do
describe 'GET show' do
let!(:board) { create(:board, project: project) }
it 'sets boards_endpoint instance variable to a boards path' do
read_board board: board
expect(assigns(:boards_endpoint)).to eq project_boards_path(project)
end
context 'when format is HTML' do
it 'renders template' do
read_board board: board
......
require 'spec_helper'
describe BoardsHelper do
describe '#board_data' do
let(:user) { create(:user) }
let(:project) { create(:project) }
let(:board) { create(:board, project: project) }
before do
assign(:board, board)
assign(:project, project)
allow(helper).to receive(:current_user) { user }
allow(helper).to receive(:can?).with(user, :admin_list, project).and_return(true)
end
it 'returns a board_lists_path as lists_endpoint' do
expect(helper.board_data[:lists_endpoint]).to eq(board_lists_path(board))
end
end
end
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册