diff options
Diffstat (limited to 'spec/helpers/boards_helper_spec.rb')
-rw-r--r-- | spec/helpers/boards_helper_spec.rb | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/spec/helpers/boards_helper_spec.rb b/spec/helpers/boards_helper_spec.rb new file mode 100644 index 00000000000..a3c5ab99c87 --- /dev/null +++ b/spec/helpers/boards_helper_spec.rb @@ -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 |