Commit 5e01ae5a authored by Luke Bennett's avatar Luke Bennett

add boards_helper_spec

parent e63d73cf
......@@ -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
......
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%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment