Permalink
Browse files

Merge pull request #1 from guitsaru/master

Add Article.article
  • Loading branch information...
2 parents fb304bb + e5bed42 commit c46c867fc02fb2832ae8e8ca2d65c4d63176b5ca @winton winton committed Jan 30, 2012
Showing with 27 additions and 2 deletions.
  1. +9 −1 lib/bleacher_api.rb
  2. +18 −1 spec/bleacher_api_spec.rb
View
@@ -25,6 +25,14 @@ def call(type, path, data=nil)
end
end
+ class Article
+ class <<self
+ def article(id, options={})
+ BleacherApi.call(:get, 'article/article', options.merge(:id => id))
+ end
+ end
+ end
+
class Authenticate
class <<self
def login(email, password, redirect=nil)
@@ -92,4 +100,4 @@ def user(token=BleacherApi::Config.token)
end
end
end
-end
+end
View
@@ -5,6 +5,23 @@
before(:all) do
@user_keys = %w(id email first_name last_name permalink token api)
end
+
+ if only?(:Article)
+ describe :Article do
+ describe :article do
+
+ describe 'success' do
+ before(:all) do
+ @response = BleacherApi::Article.article(1020834, :article => true)
+ end
+
+ it "should return a hash with valid keys" do
+ @response.keys.should == ["article"]
+ end
+ end
+ end
+ end
+ end
if only?(:Authenticate)
describe :Authenticate do
@@ -136,4 +153,4 @@
end
end
end
-end
+end

0 comments on commit c46c867

Please sign in to comment.