STILL trying to get tournament rounds filled in correctly. Wholly freaking ActiveRecord.
This commit is contained in:
@@ -18,11 +18,10 @@ describe MashTournament do
|
||||
end
|
||||
|
||||
context 'creating rounds' do
|
||||
|
||||
it 'should reject invalid numbers of contenders' do
|
||||
[11, 24, 40].each do |n|
|
||||
expect do
|
||||
subject.create_rounds(n)
|
||||
subject.create_rounds_for_contenders(n)
|
||||
end.to raise_error
|
||||
end
|
||||
end
|
||||
@@ -37,10 +36,25 @@ describe MashTournament do
|
||||
[[8, 3], [16, 4], [32, 5]].each do |n_contenders,n_rounds|
|
||||
context "for #{n_contenders} total contenders" do
|
||||
it "should create #{n_rounds} rounds" do
|
||||
subject.create_rounds(n_contenders)
|
||||
subject.create_rounds_for_contenders(n_contenders)
|
||||
subject.total_rounds.should == n_rounds
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
context 'filling in rounds' do
|
||||
before(:each) do
|
||||
subject.id.should_not be_nil
|
||||
subject.create_rounds_for_contenders(8)
|
||||
end
|
||||
|
||||
xit 'should fill in every map for every mash in a given round' do
|
||||
subject.fill_in_next_round
|
||||
subject.round(1).mashes.each do |mash|
|
||||
mash.map_a.should_not be_nil
|
||||
mash.map_b.should_not be_nil
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user