Sha256: 210afbff2c85aa524ca73eb5d88e4196f10f9ec10b4dd929f5b95a14d3978ac5

Contents?: true

Size: 1013 Bytes

Versions: 2

Compression:

Stored size: 1013 Bytes

Contents

# frozen_string_literal: true

RSpec.describe RatingChgkV2::Models::TeamModel do
  let(:team_id) { 2 }
  let(:team) do
    VCR.use_cassette('teams/team') do
      test_client.team(team_id)
    end
  end

  describe '#seasons' do
    it 'returns seasons by params' do
      season = VCR.use_cassette('teams/team_seasons_params') do
        team.seasons idseason: 9
      end.first

      expect(season).to be_an_instance_of(RatingChgkV2::Models::PlayerSeasonModel)
      expect(season.idplayer).to eq(707)
      expect(season.idseason).to eq(9)
      expect(season.idteam).to eq(team_id)
    end
  end

  describe '#tournaments' do
    it 'returns tournaments by params' do
      tour = VCR.use_cassette('teams/team_tournaments_params') do
        team.tournaments pagination: true
      end[2]

      expect(tour).to be_an_instance_of(RatingChgkV2::Models::TeamTournamentModel)
      expect(tour.idtournament).to eq(8)
      expect(tour.idteam).to eq(team_id)
    end
  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/team_model_spec.rb
rating-chgk-v2-1.0.0.rc1 spec/lib/rating_chgk_v2/models/team_model_spec.rb