diff --git a/spec/services/tournament_service_spec.rb b/spec/services/tournament_service_spec.rb new file mode 100644 index 0000000..65abd35 --- /dev/null +++ b/spec/services/tournament_service_spec.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +RSpec.describe TournamentService do + describe '#calculate_default_amount_of_teams_advancing' do + before do + @instant_finalists_amount, @intermediate_round_participants_amount = + TournamentService.calculate_default_amount_of_teams_advancing(32, 5) + end + + it 'accurately calculates @instant_finalists_amount' do + expect(@instant_finalists_amount).to eq(30) + end + + it 'accurately calculates @intermediate_round_participants_amount' do + expect(@intermediate_round_participants_amount).to eq(4) + end + end +end