Sha256: 0619e8b43bc22a61713c4527a0563b14517c95f1b06b3667b5d26a50e38ce246

Contents?: true

Size: 1.05 KB

Versions: 4

Compression:

Stored size: 1.05 KB

Contents

require "spec_helper"
require "lol"

include Lol

describe TournamentRequest do
  subject { described_class.new "api_key", "euw" }

  it "inherits from Request" do
    expect(TournamentRequest).to be < Request
  end

  describe "#create_provider" do
    it "returns the provider id" do
      expect(subject).to receive(:perform_request).with(instance_of(String), :post, { "url" => "https://foo.com", "region" => "EUW" }).and_return 10
      expect(subject.create_provider url: "https://foo.com").to eq 10
    end
  end

  describe "#create_tournament" do
    it "returns the tournament id" do
      expect(subject).to receive(:perform_request).with(instance_of(String), :post, { "providerId" => 10, "name" => "ASD" }).and_return 10
      expect(subject.create_tournament provider_id: 10, name: "ASD").to eq 10
    end
  end

  describe "#find_code" do
    it "returns a DynamicModel" do
      stub_request subject, "tournament-code", "codes/foo"
      expect(subject.find_code 'foo').to be_a DynamicModel
    end
  end

  pending '#create_codes'
  pending '#update_code'
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
ruby-lol-1.2.0 spec/lol/tournament_request_spec.rb
ruby-lol-1.1.2 spec/lol/tournament_request_spec.rb
ruby-lol-1.1.1 spec/lol/tournament_request_spec.rb
ruby-lol-1.0.0 spec/lol/tournament_request_spec.rb