@@ -1534,8 +1534,8 @@ def expect_updated_criteria_coverage_count_eq(expected_count)
1534
1534
describe '#get_next_group as instructor' do
1535
1535
let ( :role ) { create :instructor }
1536
1536
let ( :assignment ) { create :assignment }
1537
- let! ( :grouping1 ) { create :grouping , assignment : assignment , is_collected : true }
1538
- let! ( :grouping2 ) { create :grouping , assignment : assignment , is_collected : true }
1537
+ let! ( :grouping1 ) { create :grouping_with_inviter_and_submission , assignment : assignment }
1538
+ let! ( :grouping2 ) { create :grouping_with_inviter_and_submission , assignment : assignment }
1539
1539
it 'should let one navigate right if there is a result directly to the right' do
1540
1540
groupings = assignment . groupings . joins ( :group ) . order ( 'group_name' )
1541
1541
new_grouping = groupings . first . get_next_grouping ( role , false )
@@ -1558,7 +1558,7 @@ def expect_updated_criteria_coverage_count_eq(expected_count)
1558
1558
end
1559
1559
describe 'with collected results separated by an uncollected results' do
1560
1560
let! ( :grouping2 ) { create :grouping , assignment : assignment , is_collected : false }
1561
- let! ( :grouping3 ) { create :grouping , assignment : assignment , is_collected : true }
1561
+ let! ( :grouping3 ) { create :grouping_with_inviter_and_submission , assignment : assignment , is_collected : true }
1562
1562
it 'should let me navigate to the right if any result exists towards the right' do
1563
1563
groupings = assignment . groupings . joins ( :group ) . order ( 'group_name' )
1564
1564
new_grouping = groupings . first . get_next_grouping ( role , false )
@@ -1573,9 +1573,15 @@ def expect_updated_criteria_coverage_count_eq(expected_count)
1573
1573
end
1574
1574
describe '#get_next_group as ta' do
1575
1575
let ( :assignment ) { create :assignment }
1576
- let ( :role ) { create :ta , groupings : assignment . groupings }
1577
- let! ( :grouping1 ) { create :grouping , assignment : assignment , is_collected : true }
1578
- let! ( :grouping2 ) { create :grouping , assignment : assignment , is_collected : true }
1576
+ let ( :role ) { create :ta }
1577
+ let! ( :grouping1 ) { create :grouping_with_inviter_and_submission , assignment : assignment }
1578
+ let! ( :grouping2 ) { create :grouping_with_inviter_and_submission , assignment : assignment }
1579
+ let ( :groupings ) { [ grouping1 , grouping2 ] }
1580
+ before ( :each ) do
1581
+ 2 . times do |i |
1582
+ create :ta_membership , role : role , grouping : groupings [ i ]
1583
+ end
1584
+ end
1579
1585
it 'should let one navigate right if there is a result directly to the right' do
1580
1586
groupings = assignment . groupings . joins ( :group ) . order ( 'group_name' )
1581
1587
new_grouping = groupings . first . get_next_grouping ( role , false )
@@ -1598,7 +1604,10 @@ def expect_updated_criteria_coverage_count_eq(expected_count)
1598
1604
end
1599
1605
describe 'with collected results separated by an uncollected results' do
1600
1606
let! ( :grouping2 ) { create :grouping , assignment : assignment , is_collected : false }
1601
- let! ( :grouping3 ) { create :grouping , assignment : assignment , is_collected : true }
1607
+ let! ( :grouping3 ) { create :grouping_with_inviter_and_submission , assignment : assignment }
1608
+ before ( :each ) do
1609
+ create :ta_membership , role : role , grouping : grouping3
1610
+ end
1602
1611
it 'should let me navigate to the right if any result exists towards the right' do
1603
1612
groupings = assignment . groupings . joins ( :group ) . order ( 'group_name' )
1604
1613
new_grouping = groupings . first . get_next_grouping ( role , false )
0 commit comments