tumblr_wrapper 0.1.1 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
data/lib/tumblr_wrapper/http.rb
CHANGED
@@ -5,6 +5,7 @@ module TumblrWrapper::HTTP
|
|
5
5
|
connection = Faraday.new TumblrWrapper.endpoint do |conn|
|
6
6
|
conn.request :oauth, access_token if opts[:signed]
|
7
7
|
conn.request :url_encoded
|
8
|
+
conn.response :json, :content_type => /\bjson$/
|
8
9
|
conn.adapter Faraday.default_adapter
|
9
10
|
end
|
10
11
|
if opts[:signed]
|
@@ -20,6 +21,7 @@ module TumblrWrapper::HTTP
|
|
20
21
|
connection = Faraday.new TumblrWrapper.endpoint do |conn|
|
21
22
|
conn.request :oauth, access_token
|
22
23
|
conn.request :url_encoded
|
24
|
+
conn.response :json, :content_type => /\bjson$/
|
23
25
|
conn.adapter Faraday.default_adapter
|
24
26
|
end
|
25
27
|
|
@@ -33,6 +33,9 @@ describe TumblrWrapper, type: :integration do
|
|
33
33
|
|
34
34
|
blog_resource = TumblrWrapper::Blog.new(blogname, token)
|
35
35
|
info = blog_resource.info
|
36
|
+
|
37
|
+
info.body["meta"]["status"].should == 200
|
38
|
+
info.body["response"]["blog"]["title"].should == blog_title
|
36
39
|
end
|
37
40
|
end
|
38
41
|
|