add boards_helper_spec
This commit is contained in:
parent
e63d73cfa0
commit
5e01ae5a92
|
@ -65,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
|
||||
|
|
|
@ -0,0 +1,21 @@
|
|||
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
|
Loading…
Reference in New Issue