Sha256: 5d8196e0e29bbec292e1cd1b36e0218aac2870eac4ec6745d4a1975d7063c102

Contents?: true

Size: 785 Bytes

Versions: 16

Compression:

Stored size: 785 Bytes

Contents

require "spec_helper"
require "lol"

include Lol

describe GameRequest do
  it "inherits from Request" do
    expect(GameRequest.ancestors[1]).to eq(Request)
  end

  describe "#recent" do
    let(:request) { GameRequest.new "api_key", "euw" }

    subject do
      expect(request.class).to receive(:get).with(request.api_url("game/by-summoner/1/recent")).and_return load_fixture('game', GameRequest.api_version, 'get')

      request.recent 1
    end

    it 'returns an array' do
      expect(subject).to be_a Array
    end

    it 'returns an array of Games' do
      expect(subject.map(&:class).uniq).to eq [Game]
    end

    it 'fetches games from the API' do
      expect(subject.size).to eq load_fixture('game', GameRequest.api_version, 'get')['games'].size
    end
  end

end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
ruby-lol-0.9.18 spec/lol/game_request_spec.rb
ruby-lol-0.9.17 spec/lol/game_request_spec.rb
ruby-lol-0.9.16 spec/lol/game_request_spec.rb
ruby-lol-0.9.15 spec/lol/game_request_spec.rb
ruby-lol-0.9.14 spec/lol/game_request_spec.rb
ruby-lol-0.9.13 spec/lol/game_request_spec.rb
ruby-lol-0.9.12 spec/lol/game_request_spec.rb
ruby-lol-0.9.11 spec/lol/game_request_spec.rb
ruby-lol-0.9.10 spec/lol/game_request_spec.rb
ruby-lol-0.9.9 spec/lol/game_request_spec.rb
ruby-lol-0.9.8 spec/lol/game_request_spec.rb
ruby-lol-0.9.7 spec/lol/game_request_spec.rb
ruby-lol-0.9.6 spec/lol/game_request_spec.rb
ruby-lol-0.9.5 spec/lol/game_request_spec.rb
ruby-lol-0.9.4 spec/lol/game_request_spec.rb
ruby-lol-0.9.3 spec/lol/game_request_spec.rb