fb_graph 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.0
1
+ 1.0.1
data/fb_graph.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{fb_graph}
8
- s.version = "1.0.0"
8
+ s.version = "1.0.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["nov matake"]
@@ -90,6 +90,9 @@ Gem::Specification.new do |s|
90
90
  "lib/fb_graph/work.rb",
91
91
  "spec/fake_json/albums/photos/matake_private.json",
92
92
  "spec/fake_json/albums/photos/post_with_valid_access_token.json",
93
+ "spec/fake_json/applications/subscriptions/fb_graph_private.json",
94
+ "spec/fake_json/checkins/search_private.json",
95
+ "spec/fake_json/checkins/search_public.json",
93
96
  "spec/fake_json/events/attending/post_with_valid_access_token.json",
94
97
  "spec/fake_json/events/attending/smartday_private.json",
95
98
  "spec/fake_json/events/declined/post_with_valid_access_token.json",
@@ -200,6 +203,7 @@ Gem::Specification.new do |s|
200
203
  "spec/fb_graph/connections/picture_spec.rb",
201
204
  "spec/fb_graph/connections/posts_spec.rb",
202
205
  "spec/fb_graph/connections/statuses_spec.rb",
206
+ "spec/fb_graph/connections/subscriptions_spec.rb",
203
207
  "spec/fb_graph/connections/tagged_spec.rb",
204
208
  "spec/fb_graph/connections/television_spec.rb",
205
209
  "spec/fb_graph/connections/videos_spec.rb",
@@ -214,6 +218,7 @@ Gem::Specification.new do |s|
214
218
  "spec/fb_graph/photo_spec.rb",
215
219
  "spec/fb_graph/post_spec.rb",
216
220
  "spec/fb_graph/status_spec.rb",
221
+ "spec/fb_graph/subscription_spec.rb",
217
222
  "spec/fb_graph/tag_spec.rb",
218
223
  "spec/fb_graph/user_spec.rb",
219
224
  "spec/fb_graph/venue_spec.rb",
@@ -263,6 +268,7 @@ Gem::Specification.new do |s|
263
268
  "spec/fb_graph/connections/picture_spec.rb",
264
269
  "spec/fb_graph/connections/posts_spec.rb",
265
270
  "spec/fb_graph/connections/statuses_spec.rb",
271
+ "spec/fb_graph/connections/subscriptions_spec.rb",
266
272
  "spec/fb_graph/connections/tagged_spec.rb",
267
273
  "spec/fb_graph/connections/television_spec.rb",
268
274
  "spec/fb_graph/connections/videos_spec.rb",
@@ -277,6 +283,7 @@ Gem::Specification.new do |s|
277
283
  "spec/fb_graph/photo_spec.rb",
278
284
  "spec/fb_graph/post_spec.rb",
279
285
  "spec/fb_graph/status_spec.rb",
286
+ "spec/fb_graph/subscription_spec.rb",
280
287
  "spec/fb_graph/tag_spec.rb",
281
288
  "spec/fb_graph/user_spec.rb",
282
289
  "spec/fb_graph/venue_spec.rb",
@@ -15,8 +15,8 @@ module FbGraph
15
15
  @tags << FbGraph::User.new(user.delete(:id), user)
16
16
  end
17
17
  end
18
- if (location = attributes[:location])
19
- @location = FbGraph::Page.new(location.delete(:id), location)
18
+ if (place = attributes[:place])
19
+ @place = FbGraph::Page.new(place.delete(:id), place)
20
20
  end
21
21
  @message = attributes[:message]
22
22
  if (coordinates = attributes[:coordinates])
@@ -0,0 +1,12 @@
1
+ {
2
+ "data": [
3
+ {
4
+ "object": "user",
5
+ "callback_url": "http://fbgraphsample.heroku.com/subscription",
6
+ "fields": [
7
+ "email"
8
+ ],
9
+ "active": true
10
+ }
11
+ ]
12
+ }
@@ -0,0 +1,54 @@
1
+ {
2
+ "data": [
3
+ {
4
+ "id": "696876187499",
5
+ "from": {
6
+ "name": "Roger Pincombe",
7
+ "id": "12820552"
8
+ },
9
+ "tags": {
10
+ "data": [
11
+ {
12
+ "name": "Mattt Thompson",
13
+ "id": "4810308"
14
+ }
15
+ ]
16
+ },
17
+ "message": "Checking out Austin, TX",
18
+ "place": {
19
+ "id": "120454134658381",
20
+ "name": "Gowalla HQ",
21
+ "location": {
22
+ "latitude": 30.26876,
23
+ "longitude": -97.74962
24
+ }
25
+ },
26
+ "application": {
27
+ "name": "Facebook for iPhone",
28
+ "id": "6628568379"
29
+ },
30
+ "created_time": "2010-09-08T00:09:25+0000"
31
+ },
32
+ {
33
+ "id": "10100257979134665",
34
+ "from": {
35
+ "name": "Alexa Weber Andrzejewski",
36
+ "id": "12440779"
37
+ },
38
+ "message": "Studying at Foodspotting HQ",
39
+ "place": {
40
+ "id": "132375553475160",
41
+ "name": "Foodspotting HQ",
42
+ "location": {
43
+ "latitude": 37.7805613,
44
+ "longitude": -122.394293683
45
+ }
46
+ },
47
+ "application": {
48
+ "name": "Gowalla",
49
+ "id": "41188591237"
50
+ },
51
+ "created_time": "2010-09-07T19:26:45+0000"
52
+ }
53
+ ]
54
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "error": {
3
+ "type": "OAuthInvalidTokenException",
4
+ "message": "An access token is required to request this resource."
5
+ }
6
+ }
@@ -2,4 +2,28 @@ require File.join(File.dirname(__FILE__), '../spec_helper')
2
2
 
3
3
  describe FbGraph::Checkin, '.new' do
4
4
  # TODO
5
- end
5
+ end
6
+
7
+ describe FbGraph::Checkin, '.search' do
8
+ before(:all) do
9
+ fake_json(:get, 'search?type=checkin', 'checkins/search_public')
10
+ fake_json(:get, 'search?type=checkin&access_token=access_token', 'checkins/search_private')
11
+ end
12
+
13
+ context 'when no access_token given' do
14
+ it 'should raise FbGraph::Unauthorized' do
15
+ lambda do
16
+ FbGraph::Checkin.search
17
+ end.should raise_exception(FbGraph::Unauthorized)
18
+ end
19
+ end
20
+
21
+ context 'when access_token is given' do
22
+ it 'should return checkins as FbGraph::Checkin' do
23
+ checkins = FbGraph::Checkin.search(:access_token => 'access_token')
24
+ checkins.each do |checkin|
25
+ checkin.should be_instance_of(FbGraph::Checkin)
26
+ end
27
+ end
28
+ end
29
+ end
@@ -0,0 +1,18 @@
1
+ require File.join(File.dirname(__FILE__), '../../spec_helper')
2
+
3
+ context 'when included by FbGraph::Application' do
4
+ describe FbGraph::Connections::Subscriptions, '#subscriptions' do
5
+ before(:all) do
6
+ fake_json(:get, 'fb_graph/subscriptions?access_token=access_token', 'applications/subscriptions/fb_graph_private')
7
+ end
8
+
9
+ context 'when access_token is given' do
10
+ it 'should return liked pages as FbGraph::Page' do
11
+ subscriptions = FbGraph::Application.new('fb_graph', :access_token => 'access_token').subscriptions
12
+ subscriptions.each do |subscription|
13
+ subscription.should be_instance_of(FbGraph::Subscription)
14
+ end
15
+ end
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,5 @@
1
+ require File.join(File.dirname(__FILE__), '../spec_helper')
2
+
3
+ describe FbGraph::Subscription, '.new' do
4
+ # TODO
5
+ end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fb_graph
3
3
  version: !ruby/object:Gem::Version
4
- hash: 23
4
+ hash: 21
5
5
  prerelease: false
6
6
  segments:
7
7
  - 1
8
8
  - 0
9
- - 0
10
- version: 1.0.0
9
+ - 1
10
+ version: 1.0.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - nov matake
@@ -202,6 +202,9 @@ files:
202
202
  - lib/fb_graph/work.rb
203
203
  - spec/fake_json/albums/photos/matake_private.json
204
204
  - spec/fake_json/albums/photos/post_with_valid_access_token.json
205
+ - spec/fake_json/applications/subscriptions/fb_graph_private.json
206
+ - spec/fake_json/checkins/search_private.json
207
+ - spec/fake_json/checkins/search_public.json
205
208
  - spec/fake_json/events/attending/post_with_valid_access_token.json
206
209
  - spec/fake_json/events/attending/smartday_private.json
207
210
  - spec/fake_json/events/declined/post_with_valid_access_token.json
@@ -312,6 +315,7 @@ files:
312
315
  - spec/fb_graph/connections/picture_spec.rb
313
316
  - spec/fb_graph/connections/posts_spec.rb
314
317
  - spec/fb_graph/connections/statuses_spec.rb
318
+ - spec/fb_graph/connections/subscriptions_spec.rb
315
319
  - spec/fb_graph/connections/tagged_spec.rb
316
320
  - spec/fb_graph/connections/television_spec.rb
317
321
  - spec/fb_graph/connections/videos_spec.rb
@@ -326,6 +330,7 @@ files:
326
330
  - spec/fb_graph/photo_spec.rb
327
331
  - spec/fb_graph/post_spec.rb
328
332
  - spec/fb_graph/status_spec.rb
333
+ - spec/fb_graph/subscription_spec.rb
329
334
  - spec/fb_graph/tag_spec.rb
330
335
  - spec/fb_graph/user_spec.rb
331
336
  - spec/fb_graph/venue_spec.rb
@@ -403,6 +408,7 @@ test_files:
403
408
  - spec/fb_graph/connections/picture_spec.rb
404
409
  - spec/fb_graph/connections/posts_spec.rb
405
410
  - spec/fb_graph/connections/statuses_spec.rb
411
+ - spec/fb_graph/connections/subscriptions_spec.rb
406
412
  - spec/fb_graph/connections/tagged_spec.rb
407
413
  - spec/fb_graph/connections/television_spec.rb
408
414
  - spec/fb_graph/connections/videos_spec.rb
@@ -417,6 +423,7 @@ test_files:
417
423
  - spec/fb_graph/photo_spec.rb
418
424
  - spec/fb_graph/post_spec.rb
419
425
  - spec/fb_graph/status_spec.rb
426
+ - spec/fb_graph/subscription_spec.rb
420
427
  - spec/fb_graph/tag_spec.rb
421
428
  - spec/fb_graph/user_spec.rb
422
429
  - spec/fb_graph/venue_spec.rb