-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
108 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
spec/fixtures/GW2_Recipe/_find/returns_the_details_of_a_recipe_by_id.yml
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,45 @@ | ||
require "spec_helper" | ||
|
||
describe GW2::Recipe do | ||
describe ".all" do | ||
describe ".ids" do | ||
before :each do | ||
@recipes = [1275, 1276, 1277, 1278, 1279] | ||
end | ||
|
||
it "exists" do | ||
expect(GW2::Recipe.respond_to?(:all)).to eq(true) | ||
expect(GW2::Recipe.respond_to?(:ids)).to eq(true) | ||
end | ||
|
||
it "returns all recipes", :vcr do | ||
expect(GW2::Recipe.all).to include(*@recipes) | ||
expect(GW2::Recipe.ids).to include(*@recipes) | ||
end | ||
end | ||
|
||
describe ".details" do | ||
describe ".find" do | ||
before :each do | ||
@recipe_details = { | ||
"recipe_id" => "1275", | ||
"type" => "Coat", | ||
"output_item_id" => "11541", | ||
"output_item_count" => "1", | ||
"min_rating" => "25", | ||
"time_to_craft_ms" => "1000", | ||
"disciplines"=>["Leatherworker"], | ||
"flags"=>[], | ||
"type" => "RefinementEctoplasm", | ||
"output_item_id" => 46742, | ||
"output_item_count" => 1, | ||
"min_rating" => 450, | ||
"time_to_craft_ms" => 5000, | ||
"disciplines" => [ "Armorsmith", "Artificer", "Huntsman", "Weaponsmith" ], | ||
"flags" => [ "AutoLearned" ], | ||
"ingredients" => [ | ||
{"item_id" => "19797","count" => "1"}, | ||
{"item_id" => "13094","count" => "1"}, | ||
{"item_id" => "13093","count" => "1"} | ||
] | ||
{ "item_id" => 19684, "count" => 50 }, | ||
{ "item_id" => 19721, "count" => 1 }, | ||
{ "item_id" => 46747, "count" => 10 } | ||
], | ||
"id" => 7319 | ||
} | ||
end | ||
|
||
it "exists" do | ||
expect(GW2::Recipe.respond_to?(:details)).to eq(true) | ||
expect(GW2::Recipe.respond_to?(:find)).to eq(true) | ||
end | ||
|
||
it "returns the details of a recipe by id", :vcr do | ||
expect(GW2::Recipe.details(1275)).to eq(@recipe_details) | ||
expect(GW2::Recipe.find(7319)).to eq(@recipe_details) | ||
end | ||
end | ||
end |