spec/lol/match_request_spec.rb in ruby-lol-1.0.0 vs spec/lol/match_request_spec.rb in ruby-lol-1.1.1
- old
+ new
@@ -9,27 +9,14 @@
it "inherits from Request" do
expect(MatchRequest).to be < Request
end
describe "#find" do
- context "without a tournament code" do
- let(:result) { subject.find 1 }
- before { stub_request subject, 'match', "matches/1" }
-
- it "returns a DynamicModel" do
- expect(result).to be_a DynamicModel
- end
+ it "returns a DynamicModel" do
+ stub_request subject, 'match', "matches/1"
+ expect(subject.find match_id: 1).to be_a DynamicModel
end
-
- context "with a tournament code" do
- let(:result) { subject.find 1, tournament_code: 2 }
- before { stub_request subject, 'match-with-tc', "matches/1/by-tournament-code/2" }
-
- it "returns a DynamicModel" do
- expect(result).to be_a DynamicModel
- end
- end
end
describe "#find_timeline" do
it "returns a DynamicModel" do
stub_request subject, 'timeline', "timelines/by-match/1"
@@ -40,10 +27,17 @@
describe "#ids_by_tournament_code" do
it "returns a list of ids" do
stub_request subject, 'ids-by-tc', "matches/by-tournament-code/1/ids"
result = subject.ids_by_tournament_code '1'
expect(result).to be_a Array
- expect(result.map(&:class).uniq).to eq [Integer]
+ expect(result.map(&:class).uniq).to eq [Fixnum]
+ end
+ end
+
+ describe "#find_by_tournament" do
+ it "returns a DynamicModel" do
+ stub_request subject, 'match-with-tc', "matches/1/by-tournament-code/2"
+ expect(subject.find_by_tournament 1, 2).to be_a DynamicModel
end
end
describe "#all" do
it "returns a DynamicModel" do