diff options
author | Brett Walker <bwalker@gitlab.com> | 2018-11-03 05:12:19 +0300 |
---|---|---|
committer | Brett Walker <bwalker@gitlab.com> | 2018-11-03 18:33:19 +0300 |
commit | 13dbfa90d285b4614388bdca1e59fa6f5dd540f1 (patch) | |
tree | 4c8b9c856a3edb4443f963499b6cb4ff97aa2cb4 /spec | |
parent | 3cdf7c7ec137d7753bab7687b24c7c1cd880357b (diff) |
Fix transient error with boards_controller_spec
Diffstat (limited to 'spec')
-rw-r--r-- | spec/controllers/groups/boards_controller_spec.rb | 7 | ||||
-rw-r--r-- | spec/controllers/projects/boards_controller_spec.rb | 5 |
2 files changed, 7 insertions, 5 deletions
diff --git a/spec/controllers/groups/boards_controller_spec.rb b/spec/controllers/groups/boards_controller_spec.rb index f7a4a4192d6..99429c93b82 100644 --- a/spec/controllers/groups/boards_controller_spec.rb +++ b/spec/controllers/groups/boards_controller_spec.rb @@ -32,12 +32,13 @@ describe Groups::BoardsController do end it 'renders template if visited board is not found' do - visited = double + temporary_board = create(:board, group: group) + visited = create(:board_group_recent_visit, group: temporary_board.group, board: temporary_board, user: user) + temporary_board.delete - allow(visited).to receive(:board_id).and_return(12) allow_any_instance_of(Boards::Visits::LatestService).to receive(:execute).and_return(visited) - list_boards format: :html + list_boards expect(response).to render_template :index expect(response.content_type).to eq 'text/html' diff --git a/spec/controllers/projects/boards_controller_spec.rb b/spec/controllers/projects/boards_controller_spec.rb index 667eaa5e34f..8d503f6ad32 100644 --- a/spec/controllers/projects/boards_controller_spec.rb +++ b/spec/controllers/projects/boards_controller_spec.rb @@ -38,9 +38,10 @@ describe Projects::BoardsController do end it 'renders template if visited board is not found' do - visited = double + temporary_board = create(:board, project: project) + visited = create(:board_project_recent_visit, project: temporary_board.project, board: temporary_board, user: user) + temporary_board.delete - allow(visited).to receive(:board_id).and_return(12) allow_any_instance_of(Boards::Visits::LatestService).to receive(:execute).and_return(visited) list_boards |