Sha256: 0233b3c06997b668c48b811527c81c9b7ab0f2913a23a8c4c592704ff879032c

Contents?: true

Size: 1.03 KB

Versions: 2

Compression:

Stored size: 1.03 KB

Contents

# frozen_string_literal: true

RSpec.describe RatingChgkV2::Models::TournamentModel do
  let(:tournament_id) { 7798 }
  let(:tournament) do
    VCR.use_cassette('tournaments/tournament') do
      test_client.tournament(tournament_id)
    end
  end

  specify '#appeals' do
    appeals = VCR.use_cassette('tournaments/appeals') do
      tournament.appeals
    end

    expect(appeals[0].id).to eq(12_153)
    expect(appeals[0].questionNumber).to eq(20)
  end

  specify '#requests' do
    requests = VCR.use_cassette('tournaments/requests') do
      tournament.requests
    end

    expect(requests[0].id).to eq(101_060)
    expect(requests[0].status).to eq('A')
  end

  specify '#results' do
    results = VCR.use_cassette('tournaments/results') do
      tournament.results includeTeamMembers: 1, includeMasksAndControversials: 1,
                         includeTeamFlags: 1, includeRatingB: 1, town: 202
    end.first

    expect(results.team['id']).to eq(53_341)
    expect(results.position).to eq(1)
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
rating-chgk-v2-1.0.0 spec/lib/rating_chgk_v2/models/tournament_model_spec.rb
rating-chgk-v2-1.0.0.rc1 spec/lib/rating_chgk_v2/models/tournament_model_spec.rb