Sha256: 34e09bf830d24cb706f697cf70cd756a13888de6fc6077e1c1cc41d731515808

Contents?: true

Size: 561 Bytes

Versions: 1

Compression:

Stored size: 561 Bytes

Contents

require "spec_helper"
require "lol"

include Lol

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

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

    subject do
      expect(request.class).to receive(:get).with(request.api_url("v2.1", "league/by-summoner/123")).and_return(load_fixture("league", "v2.1", "get"))

      request.get(123)
    end

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

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ruby-lol-0.9.1 spec/lol/league_request_spec.rb