Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Add recipe API
- Loading branch information
Brandon Tilley
committed
Dec 19, 2011
1 parent
0f8abff
commit d5c40f5
Showing
4 changed files
with
51 additions
and
0 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
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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
class Battlenet | ||
module Recipe | ||
def recipe(id, options = {}) | ||
get "/recipe/#{id}", options | ||
end | ||
end | ||
end |
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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
--- | ||
- !ruby/struct:VCR::HTTPInteraction | ||
request: !ruby/struct:VCR::Request | ||
method: :get | ||
uri: http://us.battle.net:80/api/wow/recipe/33994 | ||
body: | ||
headers: | ||
response: !ruby/struct:VCR::Response | ||
status: !ruby/struct:VCR::ResponseStatus | ||
code: 200 | ||
message: OK | ||
headers: | ||
date: | ||
- Mon, 19 Dec 2011 17:47:30 GMT | ||
server: | ||
- Apache | ||
x-frame-options: | ||
- SAMEORIGIN | ||
content-language: | ||
- en-US | ||
content-length: | ||
- '112' | ||
vary: | ||
- Accept-Encoding | ||
content-type: | ||
- application/json;charset=utf-8 | ||
body: ! '{"id":33994,"name":"Enchant Gloves - Precise Strikes","profession":"Enchanting","icon":"spell_holy_greaterheal"}' | ||
http_version: '1.1' |
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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
require 'spec_helper' | ||
require 'battlenet' | ||
|
||
describe Battlenet::Recipe do | ||
let(:api) { Battlenet.new } | ||
|
||
it "fetches recipe data" do | ||
VCR.use_cassette('recipe') do | ||
recipe = api.recipe '33994' | ||
recipe['name'].should == "Enchant Gloves - Precise Strikes" | ||
recipe['profession'].should == "Enchanting" | ||
end | ||
end | ||
end |