Remove redirecting to last visited board
Move this to EE-only. It isn't useful here since there's only one board
This commit is contained in:
parent
7d5ee4181a
commit
2de0bcf800
|
@ -7,7 +7,6 @@ module BoardsActions
|
|||
included do
|
||||
include BoardsResponses
|
||||
|
||||
before_action :redirect_to_recent_board, only: :index
|
||||
before_action :boards, only: :index
|
||||
before_action :board, only: :show
|
||||
end
|
||||
|
@ -25,21 +24,6 @@ module BoardsActions
|
|||
|
||||
private
|
||||
|
||||
def redirect_to_recent_board
|
||||
return if request.format.json?
|
||||
|
||||
if recently_visited = Boards::Visits::LatestService.new(board_parent, current_user).execute
|
||||
board_path = case board_parent
|
||||
when Project
|
||||
namespace_project_board_path(id: recently_visited.board_id)
|
||||
when Group
|
||||
group_board_path(id: recently_visited.board_id)
|
||||
end
|
||||
|
||||
redirect_to board_path
|
||||
end
|
||||
end
|
||||
|
||||
def boards
|
||||
strong_memoize(:boards) do
|
||||
Boards::ListService.new(parent, current_user).execute
|
||||
|
|
|
@ -22,26 +22,6 @@ describe Groups::BoardsController do
|
|||
expect(response.content_type).to eq 'text/html'
|
||||
end
|
||||
|
||||
it 'redirects to latest visited board' do
|
||||
board = create(:board, group: group)
|
||||
create(:board_group_recent_visit, group: board.group, board: board, user: user)
|
||||
|
||||
list_boards
|
||||
|
||||
expect(response).to redirect_to(group_board_path(id: board.id))
|
||||
end
|
||||
|
||||
it 'renders template if visited board is not found' do
|
||||
temporary_board = create(:board, group: group)
|
||||
create(:board_group_recent_visit, group: temporary_board.group, board: temporary_board, user: user)
|
||||
temporary_board.delete
|
||||
|
||||
list_boards
|
||||
|
||||
expect(response).to render_template :index
|
||||
expect(response.content_type).to eq 'text/html'
|
||||
end
|
||||
|
||||
context 'with unauthorized user' do
|
||||
before do
|
||||
allow(Ability).to receive(:allowed?).with(user, :read_cross_project, :global).and_return(true)
|
||||
|
|
|
@ -28,26 +28,6 @@ describe Projects::BoardsController do
|
|||
expect(response.content_type).to eq 'text/html'
|
||||
end
|
||||
|
||||
it 'redirects to latest visited board' do
|
||||
board = create(:board, project: project)
|
||||
create(:board_project_recent_visit, project: board.project, board: board, user: user)
|
||||
|
||||
list_boards
|
||||
|
||||
expect(response).to redirect_to(namespace_project_board_path(id: board.id))
|
||||
end
|
||||
|
||||
it 'renders template if visited board is not found' do
|
||||
temporary_board = create(:board, project: project)
|
||||
create(:board_project_recent_visit, project: temporary_board.project, board: temporary_board, user: user)
|
||||
temporary_board.delete
|
||||
|
||||
list_boards
|
||||
|
||||
expect(response).to render_template :index
|
||||
expect(response.content_type).to eq 'text/html'
|
||||
end
|
||||
|
||||
context 'with unauthorized user' do
|
||||
before do
|
||||
allow(Ability).to receive(:allowed?).with(user, :read_project, project).and_return(true)
|
||||
|
|
Loading…
Reference in New Issue