diff options
-rw-r--r-- | app/controllers/concerns/boards_actions.rb | 16 | ||||
-rw-r--r-- | spec/controllers/groups/boards_controller_spec.rb | 20 | ||||
-rw-r--r-- | spec/controllers/projects/boards_controller_spec.rb | 20 |
3 files changed, 0 insertions, 56 deletions
diff --git a/app/controllers/concerns/boards_actions.rb b/app/controllers/concerns/boards_actions.rb index 2cf0ba7c086..ed7ea2f0e04 100644 --- a/app/controllers/concerns/boards_actions.rb +++ b/app/controllers/concerns/boards_actions.rb @@ -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 diff --git a/spec/controllers/groups/boards_controller_spec.rb b/spec/controllers/groups/boards_controller_spec.rb index 2f4a00561ac..27ee37b3817 100644 --- a/spec/controllers/groups/boards_controller_spec.rb +++ b/spec/controllers/groups/boards_controller_spec.rb @@ -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) diff --git a/spec/controllers/projects/boards_controller_spec.rb b/spec/controllers/projects/boards_controller_spec.rb index 3cf948498b7..1eeded06459 100644 --- a/spec/controllers/projects/boards_controller_spec.rb +++ b/spec/controllers/projects/boards_controller_spec.rb @@ -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) |