trollolo 0.1.1 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +21 -2
- data/.rubocop_todo.yml +105 -270
- data/CHANGELOG.md +10 -0
- data/CONTRIBUTING.md +6 -4
- data/Gemfile +1 -1
- data/README.md +10 -1
- data/Rakefile +4 -4
- data/bin/trollolo +2 -2
- data/lib/backup.rb +21 -23
- data/lib/burndown_chart.rb +46 -49
- data/lib/burndown_data.rb +21 -21
- data/lib/card.rb +23 -32
- data/lib/checklist.rb +13 -1
- data/lib/cli.rb +105 -110
- data/lib/column.rb +11 -10
- data/lib/empty_column.rb +2 -2
- data/lib/scrum/backlog_mover.rb +3 -3
- data/lib/scrum/card_type_detection.rb +1 -1
- data/lib/scrum/creator.rb +7 -7
- data/lib/scrum/prioritizer.rb +1 -1
- data/lib/scrum/sprint_board.rb +4 -4
- data/lib/scrum/sprint_cleaner.rb +3 -3
- data/lib/scrum/sprint_planning_board.rb +2 -4
- data/lib/scrum_board.rb +3 -3
- data/lib/settings.rb +29 -27
- data/lib/trello_service.rb +1 -1
- data/lib/trello_wrapper.rb +9 -9
- data/lib/version.rb +1 -1
- data/spec/data/card.json +19 -0
- data/spec/data/trollolorc +3 -0
- data/spec/integration/command_line_spec.rb +14 -14
- data/spec/integration/create_burndown_spec.rb +25 -25
- data/spec/integration/integration_spec_helper.rb +1 -1
- data/spec/integration/wrapper/credentials_input_wrapper +7 -11
- data/spec/integration/wrapper/empty_config_trollolo_wrapper +2 -2
- data/spec/integration/wrapper/trollolo_wrapper +2 -2
- data/spec/unit/backup_spec.rb +14 -14
- data/spec/unit/burndown_chart_spec.rb +176 -184
- data/spec/unit/burndown_data_spec.rb +21 -23
- data/spec/unit/card_spec.rb +38 -24
- data/spec/unit/cli_spec.rb +57 -57
- data/spec/unit/empty_column_spec.rb +1 -1
- data/spec/unit/retrieve_data_spec.rb +13 -13
- data/spec/unit/scrum/backlog_mover_spec.rb +8 -8
- data/spec/unit/scrum/card_type_detection_spec.rb +12 -12
- data/spec/unit/scrum/creator_spec.rb +8 -8
- data/spec/unit/scrum/prioritizer_spec.rb +19 -19
- data/spec/unit/scrum/priority_name_spec.rb +16 -16
- data/spec/unit/scrum/sprint_board_spec.rb +3 -3
- data/spec/unit/scrum/sprint_cleaner_spec.rb +15 -15
- data/spec/unit/scrum/sprint_planning_board_spec.rb +2 -2
- data/spec/unit/scrum_board_spec.rb +56 -56
- data/spec/unit/settings_spec.rb +23 -23
- data/spec/unit/spec_helper.rb +3 -3
- data/spec/unit/support/test_data_operations.rb +4 -0
- data/spec/unit/support/update_webmock_data +9 -11
- data/spec/unit/support/vcr.rb +3 -3
- data/spec/unit/support/webmocks.rb +21 -12
- data/spec/unit/trello_wrapper_spec.rb +40 -29
- data/trollolo.gemspec +3 -3
- metadata +8 -5
@@ -1,7 +1,7 @@
|
|
1
1
|
require_relative 'spec_helper'
|
2
2
|
|
3
3
|
describe EmptyColumn do
|
4
|
-
[
|
4
|
+
%i[committed_cards extra_cards unplanned_cards cards fast_lane_cards].each do |cards_method|
|
5
5
|
it "##{cards_method}" do
|
6
6
|
expect(subject.send(cards_method)).to eq([])
|
7
7
|
end
|
@@ -1,42 +1,42 @@
|
|
1
1
|
require_relative 'spec_helper'
|
2
2
|
|
3
|
-
describe
|
3
|
+
describe 'retrieve data through Trello API' do
|
4
4
|
before(:each) do
|
5
5
|
full_board_mock
|
6
6
|
trello_wrapper = TrelloWrapper.new(dummy_settings)
|
7
|
-
@board = trello_wrapper.board(
|
7
|
+
@board = trello_wrapper.board('53186e8391ef8671265eba9d')
|
8
8
|
end
|
9
9
|
|
10
|
-
describe
|
11
|
-
it
|
12
|
-
expect(@board.id).to eq(
|
10
|
+
describe 'board' do
|
11
|
+
it 'gets id' do
|
12
|
+
expect(@board.id).to eq('53186e8391ef8671265eba9d')
|
13
13
|
end
|
14
14
|
|
15
|
-
it
|
15
|
+
it 'gets columns' do
|
16
16
|
columns = @board.columns
|
17
17
|
expect(columns.count).to eq(6)
|
18
|
-
expect(columns[0].name).to eq(
|
18
|
+
expect(columns[0].name).to eq('Sprint Backlog')
|
19
19
|
end
|
20
20
|
|
21
|
-
it
|
21
|
+
it 'gets cards' do
|
22
22
|
cards = @board.columns[0].cards
|
23
23
|
expect(cards.count).to eq(6)
|
24
|
-
expect(cards[0].name).to eq(
|
24
|
+
expect(cards[0].name).to eq('Sprint 3')
|
25
25
|
end
|
26
26
|
|
27
|
-
it
|
27
|
+
it 'gets checklist item counts' do
|
28
28
|
card = @board.columns[1].cards[0]
|
29
29
|
expect(card.tasks).to eq(2)
|
30
30
|
expect(card.done_tasks).to eq(1)
|
31
31
|
end
|
32
32
|
|
33
|
-
it
|
33
|
+
it 'gets card labels' do
|
34
34
|
card = @board.columns[0].cards[5]
|
35
35
|
expect(card.card_labels.count).to eq(1)
|
36
|
-
expect(card.card_labels[0][
|
36
|
+
expect(card.card_labels[0]['name']).to eq('Under waterline')
|
37
37
|
end
|
38
38
|
|
39
|
-
it
|
39
|
+
it 'gets card description' do
|
40
40
|
card = @board.columns[2].cards[1]
|
41
41
|
expected_desc = <<EOT
|
42
42
|
```yaml
|
@@ -1,20 +1,20 @@
|
|
1
|
-
require_relative
|
1
|
+
require_relative '../spec_helper'
|
2
2
|
|
3
3
|
describe Scrum::BacklogMover do
|
4
4
|
subject { described_class.new(dummy_settings) }
|
5
5
|
|
6
|
-
it
|
6
|
+
it 'creates new move backlog' do
|
7
7
|
expect(subject).to be
|
8
8
|
end
|
9
9
|
|
10
|
-
it
|
11
|
-
expect
|
12
|
-
subject.move(
|
13
|
-
|
10
|
+
it 'fails without moving if sprint backlog is missing from sprint board', vcr: 'move_backlog_missing_backlog', vcr_record: false do
|
11
|
+
expect do
|
12
|
+
subject.move('neUHHzDo', 'NzGCbEeN')
|
13
|
+
end.to raise_error('sprint board is missing Sprint Backlog list')
|
14
14
|
end
|
15
15
|
|
16
|
-
it
|
16
|
+
it 'moves cards to sprint board', vcr: 'move_backlog', vcr_record: false do
|
17
17
|
expect(STDOUT).to receive(:puts).exactly(11).times
|
18
|
-
subject.move(
|
18
|
+
subject.move('neUHHzDo', 'NzGCbEeN')
|
19
19
|
end
|
20
20
|
end
|
@@ -1,35 +1,35 @@
|
|
1
|
-
require_relative
|
1
|
+
require_relative '../spec_helper'
|
2
2
|
|
3
3
|
describe Scrum::CardTypeDetection do
|
4
4
|
let(:dummy_class) { Class.new { include Scrum::CardTypeDetection } }
|
5
5
|
subject { dummy_class.new }
|
6
|
-
let(:waterline_card) { instance_double(
|
7
|
-
let(:upcase_waterline_card) { instance_double(
|
8
|
-
let(:fancy_waterline_card) { instance_double(
|
9
|
-
let(:seabed_card) { instance_double(
|
10
|
-
let(:fancy_seabed_card) { instance_double(
|
6
|
+
let(:waterline_card) { instance_double('Card', name: 'waterline') }
|
7
|
+
let(:upcase_waterline_card) { instance_double('Card', name: 'Waterline') }
|
8
|
+
let(:fancy_waterline_card) { instance_double('Card', name: '~~~ WaTeR lInE ~~~') }
|
9
|
+
let(:seabed_card) { instance_double('Card', name: 'seabed') }
|
10
|
+
let(:fancy_seabed_card) { instance_double('Card', name: '!-! Sea Bed !-!') }
|
11
11
|
|
12
|
-
it
|
12
|
+
it 'recognizes waterline string' do
|
13
13
|
expect(subject.waterline?(waterline_card)).to be_truthy
|
14
14
|
end
|
15
15
|
|
16
|
-
it
|
16
|
+
it 'refuses non waterline name' do
|
17
17
|
expect(subject.waterline?(seabed_card)).to be_falsy
|
18
18
|
end
|
19
19
|
|
20
|
-
it
|
20
|
+
it 'recognizes upcase spellings of waterline' do
|
21
21
|
expect(subject.waterline?(upcase_waterline_card)).to be_truthy
|
22
22
|
end
|
23
23
|
|
24
|
-
it
|
24
|
+
it 'recognizes fancy spellings of waterline' do
|
25
25
|
expect(subject.waterline?(fancy_waterline_card)).to be_truthy
|
26
26
|
end
|
27
27
|
|
28
|
-
it
|
28
|
+
it 'recognizes fancy spellings of seabed' do
|
29
29
|
expect(subject.seabed?(fancy_seabed_card)).to be_truthy
|
30
30
|
end
|
31
31
|
|
32
|
-
it
|
32
|
+
it 'refuses non seabed name' do
|
33
33
|
expect(subject.seabed?(waterline_card)).to be_falsy
|
34
34
|
end
|
35
35
|
end
|
@@ -1,22 +1,22 @@
|
|
1
|
-
require_relative
|
1
|
+
require_relative '../spec_helper'
|
2
2
|
|
3
3
|
describe Scrum::Creator do
|
4
4
|
subject { described_class.new(dummy_settings) }
|
5
|
-
let(:custom_subject)
|
5
|
+
let(:custom_subject) do
|
6
6
|
custom_settings = dummy_settings
|
7
|
-
custom_settings.scrum.board_names[
|
7
|
+
custom_settings.scrum.board_names['planning'] = 'Planungs Brett'
|
8
8
|
described_class.new(custom_settings)
|
9
|
-
|
9
|
+
end
|
10
10
|
|
11
|
-
it
|
11
|
+
it 'creates new creator' do
|
12
12
|
expect(subject).to be
|
13
13
|
end
|
14
14
|
|
15
|
-
context
|
16
|
-
it
|
15
|
+
context 'default' do
|
16
|
+
it 'creates boards from default config', vcr: 'creator_default_config', vcr_record: false do
|
17
17
|
expect { subject.create }.not_to raise_error
|
18
18
|
end
|
19
|
-
it
|
19
|
+
it 'creates boards according to existing config', vcr: 'creator_custom_config', vcr_record: false do
|
20
20
|
expect { custom_subject.create }.not_to raise_error
|
21
21
|
end
|
22
22
|
end
|
@@ -1,45 +1,45 @@
|
|
1
|
-
require_relative
|
1
|
+
require_relative '../spec_helper'
|
2
2
|
|
3
3
|
describe Scrum::Prioritizer do
|
4
4
|
subject { described_class.new(dummy_settings) }
|
5
5
|
|
6
|
-
it
|
6
|
+
it 'creates new prioritizer' do
|
7
7
|
expect(subject).to be
|
8
8
|
end
|
9
9
|
|
10
|
-
context
|
11
|
-
it
|
12
|
-
expect { subject.prioritize(
|
10
|
+
context 'default' do
|
11
|
+
it 'raises an exception if board is not found', vcr: 'prioritize_no_backlog_list', vcr_record: false do
|
12
|
+
expect { subject.prioritize('xxxxx123') }.to raise_error(Trello::Error)
|
13
13
|
end
|
14
14
|
|
15
|
-
it
|
16
|
-
expect { subject.prioritize(
|
15
|
+
it 'raises an exception if list is not on board', vcr: 'prioritize_no_backlog_list', vcr_record: false do
|
16
|
+
expect { subject.prioritize('neUHHzDo') }.to raise_error("list named 'Backlog' not found on board")
|
17
17
|
end
|
18
18
|
|
19
|
-
it
|
19
|
+
it 'adds priority text to card titles', vcr: 'prioritize_backlog_list', vcr_record: false do
|
20
20
|
expect(STDOUT).to receive(:puts).exactly(13).times
|
21
|
-
expect { subject.prioritize(
|
21
|
+
expect { subject.prioritize('neUHHzDo') }.not_to raise_error
|
22
22
|
end
|
23
23
|
end
|
24
24
|
|
25
|
-
context
|
25
|
+
context 'specifying backlog list as argument' do
|
26
26
|
before do
|
27
|
-
subject.settings.scrum.list_names[
|
27
|
+
subject.settings.scrum.list_names['planning_backlog'] = 'Nonexisting List'
|
28
28
|
end
|
29
29
|
|
30
|
-
it
|
30
|
+
it 'finds backlog list', vcr: 'prioritize_backlog_list', vcr_record: false do
|
31
31
|
expect(STDOUT).to receive(:puts).exactly(13).times
|
32
|
-
expect
|
33
|
-
subject.prioritize(
|
34
|
-
|
32
|
+
expect do
|
33
|
+
subject.prioritize('neUHHzDo', 'Backlog')
|
34
|
+
end.not_to raise_error
|
35
35
|
end
|
36
36
|
|
37
|
-
it
|
38
|
-
expect { subject.prioritize(
|
37
|
+
it 'throws error when default list does not exist', vcr: 'prioritize_backlog_list', vcr_record: false do
|
38
|
+
expect { subject.prioritize('neUHHzDo') }.to raise_error("list named 'Nonexisting List' not found on board")
|
39
39
|
end
|
40
40
|
|
41
|
-
it
|
42
|
-
expect { subject.prioritize(
|
41
|
+
it 'throws error when specified list does not exist', vcr: 'prioritize_backlog_list', vcr_record: false do
|
42
|
+
expect { subject.prioritize('neUHHzDo', 'My Backlog') }.to raise_error("list named 'My Backlog' not found on board")
|
43
43
|
end
|
44
44
|
end
|
45
45
|
end
|
@@ -1,35 +1,35 @@
|
|
1
|
-
require_relative
|
1
|
+
require_relative '../spec_helper'
|
2
2
|
|
3
3
|
describe Scrum::PriorityName do
|
4
4
|
let(:priority_name) { Scrum::PriorityName }
|
5
5
|
|
6
|
-
describe
|
7
|
-
it
|
8
|
-
expect(priority_name.priority(
|
6
|
+
describe 'parses name' do
|
7
|
+
it 'extracts priority number from card name' do
|
8
|
+
expect(priority_name.priority('(0.5) P1: Refactor cards')).to eq(1)
|
9
9
|
end
|
10
10
|
|
11
|
-
it
|
12
|
-
expect(priority_name.priority(
|
11
|
+
it 'extracts priority number from card name if it is at the beginning ' do
|
12
|
+
expect(priority_name.priority('P01: (3) Refactor cards')).to eq(1)
|
13
13
|
end
|
14
14
|
end
|
15
15
|
|
16
|
-
describe
|
17
|
-
it
|
16
|
+
describe 'updates priority' do
|
17
|
+
it 'updates existing priority in title' do
|
18
18
|
expect(
|
19
|
-
priority_name.build(
|
20
|
-
).to eq(
|
19
|
+
priority_name.build('P01: (3) Refactor cards', 3)
|
20
|
+
).to eq('P3: (3) Refactor cards')
|
21
21
|
end
|
22
22
|
|
23
|
-
it
|
23
|
+
it 'adds new priority text to title' do
|
24
24
|
expect(
|
25
|
-
priority_name.build(
|
26
|
-
).to eq(
|
25
|
+
priority_name.build('(3) Refactor cards', 4)
|
26
|
+
).to eq('P4: (3) Refactor cards')
|
27
27
|
end
|
28
28
|
|
29
|
-
it
|
29
|
+
it 'updates priority after story points' do
|
30
30
|
expect(
|
31
|
-
priority_name.build(
|
32
|
-
).to eq(
|
31
|
+
priority_name.build('(0.5) P1: Refactor cards', 4)
|
32
|
+
).to eq('(0.5) P4: Refactor cards')
|
33
33
|
end
|
34
34
|
end
|
35
35
|
end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
require_relative
|
1
|
+
require_relative '../spec_helper'
|
2
2
|
|
3
3
|
describe Scrum::SprintBoard do
|
4
4
|
subject!(:sprint_board) { described_class.new(dummy_settings.scrum) }
|
@@ -8,13 +8,13 @@ describe Scrum::SprintBoard do
|
|
8
8
|
TrelloService.new(dummy_settings)
|
9
9
|
end
|
10
10
|
|
11
|
-
it
|
11
|
+
it 'places existing waterline card at bottom and removes from planning board', vcr: 'sprint_board', vcr_record: false do
|
12
12
|
sprint_board.setup('NzGCbEeN')
|
13
13
|
planning_board.setup('neUHHzDo')
|
14
14
|
sprint_board.place_waterline(planning_board.waterline_card)
|
15
15
|
end
|
16
16
|
|
17
|
-
it
|
17
|
+
it 'moves waterline card from planning to bottom', vcr: 'sprint_board_no_waterline', vcr_record: false do
|
18
18
|
sprint_board.setup('NzGCbEeN')
|
19
19
|
planning_board.setup('neUHHzDo')
|
20
20
|
sprint_board.place_waterline(planning_board.waterline_card)
|
@@ -1,38 +1,38 @@
|
|
1
|
-
require_relative
|
1
|
+
require_relative '../spec_helper'
|
2
2
|
|
3
3
|
describe Scrum::SprintCleaner do
|
4
4
|
subject { described_class.new(dummy_settings) }
|
5
5
|
|
6
|
-
it
|
6
|
+
it 'creates new sprint cleanup' do
|
7
7
|
expect(subject).to be
|
8
8
|
end
|
9
9
|
|
10
|
-
it
|
10
|
+
it 'moves remaining cards to target board', vcr: 'sprint_cleanup', vcr_record: false do
|
11
11
|
expect(STDOUT).to receive(:puts).exactly(13).times
|
12
|
-
expect(subject.cleanup(
|
12
|
+
expect(subject.cleanup('7Zar7bNm', '72tOJsGS')).to be
|
13
13
|
end
|
14
14
|
|
15
|
-
context
|
15
|
+
context 'given correct burndown-data-xx.yaml' do
|
16
16
|
before do
|
17
17
|
allow_any_instance_of(BurndownChart).to receive(:update)
|
18
18
|
end
|
19
19
|
|
20
|
-
it
|
21
|
-
expect
|
22
|
-
subject.cleanup(
|
23
|
-
|
20
|
+
it 'generates new burndown data', vcr: 'sprint_cleanup', vcr_record: false do
|
21
|
+
expect do
|
22
|
+
subject.cleanup('7Zar7bNm', '72tOJsGS')
|
23
|
+
end.to output(/^(New burndown data was generated automatically)/).to_stdout
|
24
24
|
end
|
25
25
|
end
|
26
26
|
|
27
|
-
context
|
27
|
+
context 'with non-existing target list on target board' do
|
28
28
|
before do
|
29
|
-
subject.settings.scrum.list_names[
|
29
|
+
subject.settings.scrum.list_names['planning_ready'] = 'Nonexisting List'
|
30
30
|
end
|
31
31
|
|
32
|
-
it
|
33
|
-
expect
|
34
|
-
subject.cleanup(
|
35
|
-
|
32
|
+
it 'throws error', vcr: 'sprint_cleanup', vcr_record: false do
|
33
|
+
expect do
|
34
|
+
subject.cleanup('7Zar7bNm', '72tOJsGS')
|
35
|
+
end.to raise_error /'Nonexisting List' not found/
|
36
36
|
end
|
37
37
|
end
|
38
38
|
end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
require_relative
|
1
|
+
require_relative '../spec_helper'
|
2
2
|
|
3
3
|
describe Scrum::SprintPlanningBoard do
|
4
4
|
subject(:planning_board) { described_class.new(dummy_settings.scrum) }
|
@@ -7,7 +7,7 @@ describe Scrum::SprintPlanningBoard do
|
|
7
7
|
TrelloService.new(dummy_settings)
|
8
8
|
end
|
9
9
|
|
10
|
-
it
|
10
|
+
it 'has a waterline card', vcr: 'sprint_planning_board', vcr_record: false do
|
11
11
|
planning_board.setup('neUHHzDo')
|
12
12
|
expect(planning_board.waterline_card).to be
|
13
13
|
end
|
@@ -5,7 +5,7 @@ describe ScrumBoard do
|
|
5
5
|
it 'raises error when done column cannot be found' do
|
6
6
|
settings = dummy_settings
|
7
7
|
|
8
|
-
board_data = JSON.parse(load_test_file(
|
8
|
+
board_data = JSON.parse(load_test_file('full-board.json'))
|
9
9
|
scrum_board = ScrumBoard.new(board_data, settings)
|
10
10
|
|
11
11
|
settings.done_column_name_regex = /thiscolumndoesntexist/
|
@@ -19,20 +19,20 @@ describe ScrumBoard do
|
|
19
19
|
columns = []
|
20
20
|
|
21
21
|
column1 = double
|
22
|
-
allow(column1).to receive(:name).and_return(
|
22
|
+
allow(column1).to receive(:name).and_return('Sprint Backlog')
|
23
23
|
columns << column1
|
24
24
|
|
25
25
|
column2 = double
|
26
|
-
allow(column2).to receive(:name).and_return(
|
26
|
+
allow(column2).to receive(:name).and_return('Doing')
|
27
27
|
columns << column2
|
28
28
|
|
29
29
|
column3 = double
|
30
|
-
allow(column3).to receive(:name).and_return(
|
30
|
+
allow(column3).to receive(:name).and_return('Done Sprint 43')
|
31
31
|
columns << column3
|
32
32
|
|
33
33
|
allow(scrum_board).to receive(:columns).and_return(columns)
|
34
34
|
|
35
|
-
expect(scrum_board.done_column.name).to eq(
|
35
|
+
expect(scrum_board.done_column.name).to eq('Done Sprint 43')
|
36
36
|
end
|
37
37
|
|
38
38
|
it 'finds done column with name "Done Sprint %s" if there are multiple done columns' do
|
@@ -41,24 +41,24 @@ describe ScrumBoard do
|
|
41
41
|
columns = []
|
42
42
|
|
43
43
|
column1 = double
|
44
|
-
allow(column1).to receive(:name).and_return(
|
44
|
+
allow(column1).to receive(:name).and_return('Sprint Backlog')
|
45
45
|
columns << column1
|
46
46
|
|
47
47
|
column2 = double
|
48
|
-
allow(column2).to receive(:name).and_return(
|
48
|
+
allow(column2).to receive(:name).and_return('Doing')
|
49
49
|
columns << column2
|
50
50
|
|
51
51
|
column3 = double
|
52
|
-
allow(column3).to receive(:name).and_return(
|
52
|
+
allow(column3).to receive(:name).and_return('Done Sprint 44')
|
53
53
|
columns << column3
|
54
54
|
|
55
55
|
column4 = double
|
56
|
-
allow(column4).to receive(:name).and_return(
|
56
|
+
allow(column4).to receive(:name).and_return('Done Sprint 43')
|
57
57
|
columns << column4
|
58
58
|
|
59
59
|
allow(scrum_board).to receive(:columns).and_return(columns)
|
60
60
|
|
61
|
-
expect(scrum_board.done_column.name).to eq(
|
61
|
+
expect(scrum_board.done_column.name).to eq('Done Sprint 44')
|
62
62
|
end
|
63
63
|
|
64
64
|
it 'finds done column with name "Done (July 20th - August 3rd)"' do
|
@@ -67,109 +67,109 @@ describe ScrumBoard do
|
|
67
67
|
columns = []
|
68
68
|
|
69
69
|
column1 = double
|
70
|
-
allow(column1).to receive(:name).and_return(
|
70
|
+
allow(column1).to receive(:name).and_return('Sprint Backlog')
|
71
71
|
columns << column1
|
72
72
|
|
73
73
|
column2 = double
|
74
|
-
allow(column2).to receive(:name).and_return(
|
74
|
+
allow(column2).to receive(:name).and_return('Doing')
|
75
75
|
columns << column2
|
76
76
|
|
77
77
|
column3 = double
|
78
|
-
allow(column3).to receive(:name).and_return(
|
78
|
+
allow(column3).to receive(:name).and_return('Done (July 20th - August 3rd)')
|
79
79
|
columns << column3
|
80
80
|
|
81
81
|
allow(scrum_board).to receive(:columns).and_return(columns)
|
82
82
|
|
83
|
-
expect(scrum_board.done_column.name).to eq(
|
83
|
+
expect(scrum_board.done_column.name).to eq('Done (July 20th - August 3rd)')
|
84
84
|
end
|
85
85
|
end
|
86
86
|
|
87
|
-
describe
|
88
|
-
context
|
89
|
-
let(:board) { ScrumBoard.new(JSON.parse(load_test_file(
|
87
|
+
describe 'card counts' do
|
88
|
+
context 'full board' do
|
89
|
+
let(:board) { ScrumBoard.new(JSON.parse(load_test_file('full-board.json')), dummy_settings) }
|
90
90
|
|
91
|
-
it
|
91
|
+
it '#done_cards' do
|
92
92
|
expect(board.done_cards.count).to eq(3)
|
93
|
-
expect(board.done_cards[0].name).to eq(
|
94
|
-
expect(board.done_cards[1].name).to eq(
|
95
|
-
expect(board.done_cards[2].name).to eq(
|
93
|
+
expect(board.done_cards[0].name).to eq('Burndown chart')
|
94
|
+
expect(board.done_cards[1].name).to eq('Sprint 10')
|
95
|
+
expect(board.done_cards[2].name).to eq('(3) P3: Fill Done columns')
|
96
96
|
end
|
97
97
|
|
98
|
-
it
|
98
|
+
it '#extra_cards' do
|
99
99
|
expect(board.extra_cards.count).to eq(1)
|
100
|
-
expect(board.extra_cards[0].name).to eq(
|
100
|
+
expect(board.extra_cards[0].name).to eq('(8) P6: Celebrate testing board')
|
101
101
|
end
|
102
102
|
|
103
|
-
it
|
103
|
+
it '#extra_done_cards' do
|
104
104
|
expect(board.extra_done_cards.count).to eq(0)
|
105
105
|
end
|
106
106
|
|
107
|
-
it
|
107
|
+
it '#unplanned_cards' do
|
108
108
|
expect(board.unplanned_cards.count).to eq(2)
|
109
|
-
expect(board.unplanned_cards[0].name).to eq(
|
110
|
-
expect(board.unplanned_cards[1].name).to eq(
|
109
|
+
expect(board.unplanned_cards[0].name).to eq('(2) Some unplanned work')
|
110
|
+
expect(board.unplanned_cards[1].name).to eq('(1) Fix emergency')
|
111
111
|
end
|
112
112
|
|
113
|
-
it
|
113
|
+
it '#unplanned_done_cards' do
|
114
114
|
expect(board.unplanned_done_cards.count).to eq(1)
|
115
|
-
expect(board.unplanned_done_cards[0].name).to eq(
|
115
|
+
expect(board.unplanned_done_cards[0].name).to eq('(2) Some unplanned work')
|
116
116
|
end
|
117
117
|
|
118
|
-
it
|
118
|
+
it '#done_fast_lane_cards_count' do
|
119
119
|
expect(board.done_fast_lane_cards_count).to eq(0)
|
120
120
|
end
|
121
121
|
|
122
|
-
it
|
122
|
+
it '#scrum_cards' do
|
123
123
|
expect(board.scrum_cards.count).to eq(4)
|
124
|
-
expect(board.scrum_cards[0].name).to eq(
|
125
|
-
expect(board.scrum_cards[1].name).to eq(
|
126
|
-
expect(board.scrum_cards[2].name).to eq(
|
127
|
-
expect(board.scrum_cards[3].name).to eq(
|
124
|
+
expect(board.scrum_cards[0].name).to eq('Burndown chart')
|
125
|
+
expect(board.scrum_cards[1].name).to eq('Sprint 10')
|
126
|
+
expect(board.scrum_cards[2].name).to eq('(3) P3: Fill Done columns')
|
127
|
+
expect(board.scrum_cards[3].name).to eq('(2) Some unplanned work')
|
128
128
|
end
|
129
129
|
end
|
130
130
|
|
131
131
|
context "full board with 'Accepted' column" do
|
132
|
-
let(:board) { ScrumBoard.new(JSON.parse(load_test_file(
|
132
|
+
let(:board) { ScrumBoard.new(JSON.parse(load_test_file('full-board-with-accepted.json')), dummy_settings) }
|
133
133
|
|
134
|
-
it
|
134
|
+
it '#done_cards' do
|
135
135
|
expect(board.done_cards.count).to eq(4)
|
136
|
-
expect(board.done_cards[0].name).to eq(
|
137
|
-
expect(board.done_cards[1].name).to eq(
|
138
|
-
expect(board.done_cards[2].name).to eq(
|
139
|
-
expect(board.done_cards[3].name).to eq(
|
136
|
+
expect(board.done_cards[0].name).to eq('Burndown chart')
|
137
|
+
expect(board.done_cards[1].name).to eq('Sprint 10')
|
138
|
+
expect(board.done_cards[2].name).to eq('(2) P7: Add Accepted column')
|
139
|
+
expect(board.done_cards[3].name).to eq('(3) P3: Fill Done columns')
|
140
140
|
end
|
141
141
|
|
142
|
-
it
|
142
|
+
it '#extra_cards' do
|
143
143
|
expect(board.extra_cards.count).to eq(1)
|
144
|
-
expect(board.extra_cards[0].name).to eq(
|
144
|
+
expect(board.extra_cards[0].name).to eq('(8) P6: Celebrate testing board')
|
145
145
|
end
|
146
146
|
|
147
|
-
it
|
147
|
+
it '#extra_done_cards' do
|
148
148
|
expect(board.extra_done_cards.count).to eq(0)
|
149
149
|
end
|
150
150
|
|
151
|
-
it
|
151
|
+
it '#unplanned_cards' do
|
152
152
|
expect(board.unplanned_cards.count).to eq(2)
|
153
|
-
expect(board.unplanned_cards[0].name).to eq(
|
154
|
-
expect(board.unplanned_cards[1].name).to eq(
|
153
|
+
expect(board.unplanned_cards[0].name).to eq('(2) Some unplanned work')
|
154
|
+
expect(board.unplanned_cards[1].name).to eq('(1) Fix emergency')
|
155
155
|
end
|
156
156
|
|
157
|
-
it
|
157
|
+
it '#unplanned_done_cards' do
|
158
158
|
expect(board.unplanned_done_cards.count).to eq(1)
|
159
|
-
expect(board.unplanned_done_cards[0].name).to eq(
|
159
|
+
expect(board.unplanned_done_cards[0].name).to eq('(2) Some unplanned work')
|
160
160
|
end
|
161
161
|
|
162
|
-
it
|
162
|
+
it '#done_fast_lane_cards_count' do
|
163
163
|
expect(board.done_fast_lane_cards_count).to eq(0)
|
164
164
|
end
|
165
165
|
|
166
|
-
it
|
166
|
+
it '#scrum_cards' do
|
167
167
|
expect(board.scrum_cards.count).to eq(5)
|
168
|
-
expect(board.scrum_cards[0].name).to eq(
|
169
|
-
expect(board.scrum_cards[1].name).to eq(
|
170
|
-
expect(board.scrum_cards[2].name).to eq(
|
171
|
-
expect(board.scrum_cards[3].name).to eq(
|
172
|
-
expect(board.scrum_cards[4].name).to eq(
|
168
|
+
expect(board.scrum_cards[0].name).to eq('Burndown chart')
|
169
|
+
expect(board.scrum_cards[1].name).to eq('Sprint 10')
|
170
|
+
expect(board.scrum_cards[2].name).to eq('(2) Some unplanned work')
|
171
|
+
expect(board.scrum_cards[3].name).to eq('(2) P7: Add Accepted column')
|
172
|
+
expect(board.scrum_cards[4].name).to eq('(3) P3: Fill Done columns')
|
173
173
|
end
|
174
174
|
end
|
175
175
|
end
|