spec/unit/scrum_board_spec.rb in trollolo-0.2.0 vs spec/unit/scrum_board_spec.rb in trollolo-0.3.0

- old
+ new

@@ -1,8 +1,26 @@ require_relative 'spec_helper' describe ScrumBoard do + describe '#todo_columns' do + let(:board) { ScrumBoard.new(JSON.parse(load_test_file('full-board.json')), dummy_settings) } + + it 'finds column' do + expect(board.todo_columns.count).to eq(1) + expect(board.todo_columns.first.name).to eq('Sprint Backlog') + end + end + + describe '#doing_columns' do + let(:board) { ScrumBoard.new(JSON.parse(load_test_file('full-board.json')), dummy_settings) } + + it 'finds columns' do + expect(board.doing_columns.count).to eq(1) + expect(board.doing_columns.first.name).to eq('Doing') + end + end + describe '#done_column' do it 'raises error when done column cannot be found' do settings = dummy_settings board_data = JSON.parse(load_test_file('full-board.json')) @@ -169,8 +187,21 @@ expect(board.scrum_cards[1].name).to eq('Sprint 10') expect(board.scrum_cards[2].name).to eq('(2) Some unplanned work') expect(board.scrum_cards[3].name).to eq('(2) P7: Add Accepted column') expect(board.scrum_cards[4].name).to eq('(3) P3: Fill Done columns') end + end + end + + describe '#accepted_columns' do + let :subject do + BoardMock.new(dummy_settings) + .list('Accepted Sprint 2') + .list('Accepted Sprint 1') + end + + it 'returns list of accepted columns' do + expect(subject.accepted_columns.count).to eq(2) + expect(subject.accepted_columns.map(&:name)).to eq(['Accepted Sprint 2', 'Accepted Sprint 1']) end end end