Sha256: ea192e7d840708e1378d01e96adc89a82279e55a3d258d727791597e92a3a6d1

Contents?: true

Size: 896 Bytes

Versions: 8

Compression:

Stored size: 896 Bytes

Contents

require "spec_helper"
require "lol"

include Lol

describe TeamRequest do
  let(:request) { TeamRequest.new "api_key", "euw" }

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

  describe "get" do
    let(:request) { TeamRequest.new "api_key", "euw" }
    let(:fixture) { load_fixture 'team', TeamRequest.api_version, 'get' }

    subject do
      expect(request.class).to receive(:get).with(request.api_url("team/by-summoner/1")).and_return fixture
      request.get 1
    end

    it 'requires a summoner' do
      expect { request.get }.to raise_error ArgumentError
    end

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

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

    it 'fetches Team from the API' do
      expect(subject.size).to eq fixture.size
    end
  end

end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
ruby-lol-0.9.10 spec/lol/team_request_spec.rb
ruby-lol-0.9.9 spec/lol/team_request_spec.rb
ruby-lol-0.9.8 spec/lol/team_request_spec.rb
ruby-lol-0.9.7 spec/lol/team_request_spec.rb
ruby-lol-0.9.6 spec/lol/team_request_spec.rb
ruby-lol-0.9.5 spec/lol/team_request_spec.rb
ruby-lol-0.9.4 spec/lol/team_request_spec.rb
ruby-lol-0.9.3 spec/lol/team_request_spec.rb