fb_graph 1.7.5 → 1.8.0.alpha

Sign up to get free protection for your applications and to get access to all the features.
Files changed (61) hide show
  1. data/Gemfile.lock +4 -2
  2. data/VERSION +1 -1
  3. data/fb_graph.gemspec +2 -1
  4. data/lib/fb_graph/album.rb +0 -9
  5. data/lib/fb_graph/connections/picture.rb +3 -2
  6. data/lib/fb_graph/node.rb +23 -33
  7. data/lib/fb_graph/query.rb +6 -10
  8. data/lib/fb_graph.rb +1 -0
  9. data/spec/fb_graph/album_spec.rb +54 -75
  10. data/spec/fb_graph/app_request_spec.rb +2 -2
  11. data/spec/fb_graph/checkin_spec.rb +2 -3
  12. data/spec/fb_graph/collection_spec.rb +1 -3
  13. data/spec/fb_graph/connection_spec.rb +6 -12
  14. data/spec/fb_graph/connections/accounts_spec.rb +2 -6
  15. data/spec/fb_graph/connections/activities_spec.rb +1 -3
  16. data/spec/fb_graph/connections/albums_spec.rb +2 -5
  17. data/spec/fb_graph/connections/app_requests_spec.rb +1 -3
  18. data/spec/fb_graph/connections/attending_spec.rb +2 -6
  19. data/spec/fb_graph/connections/books_spec.rb +1 -3
  20. data/spec/fb_graph/connections/checkins_spec.rb +2 -6
  21. data/spec/fb_graph/connections/comments_spec.rb +1 -1
  22. data/spec/fb_graph/connections/declined_spec.rb +2 -6
  23. data/spec/fb_graph/connections/events_spec.rb +1 -3
  24. data/spec/fb_graph/connections/family_spec.rb +1 -3
  25. data/spec/fb_graph/connections/feed_spec.rb +1 -3
  26. data/spec/fb_graph/connections/former_participants_spec.rb +1 -2
  27. data/spec/fb_graph/connections/friend_lists_spec.rb +1 -3
  28. data/spec/fb_graph/connections/friends_spec.rb +2 -6
  29. data/spec/fb_graph/connections/games_spec.rb +1 -3
  30. data/spec/fb_graph/connections/groups_spec.rb +1 -3
  31. data/spec/fb_graph/connections/home_spec.rb +2 -6
  32. data/spec/fb_graph/connections/insights_spec.rb +3 -9
  33. data/spec/fb_graph/connections/interests_spec.rb +1 -3
  34. data/spec/fb_graph/connections/invited_spec.rb +1 -3
  35. data/spec/fb_graph/connections/likes_spec.rb +4 -8
  36. data/spec/fb_graph/connections/links_spec.rb +1 -3
  37. data/spec/fb_graph/connections/maybe_spec.rb +1 -3
  38. data/spec/fb_graph/connections/members_spec.rb +1 -3
  39. data/spec/fb_graph/connections/messages_spec.rb +1 -4
  40. data/spec/fb_graph/connections/movies_spec.rb +1 -3
  41. data/spec/fb_graph/connections/music_spec.rb +1 -3
  42. data/spec/fb_graph/connections/noreply_spec.rb +1 -3
  43. data/spec/fb_graph/connections/notes_spec.rb +2 -5
  44. data/spec/fb_graph/connections/participants_spec.rb +1 -4
  45. data/spec/fb_graph/connections/permissions_spec.rb +1 -3
  46. data/spec/fb_graph/connections/photos_spec.rb +1 -3
  47. data/spec/fb_graph/connections/senders_spec.rb +1 -4
  48. data/spec/fb_graph/connections/statuses_spec.rb +2 -6
  49. data/spec/fb_graph/connections/subscriptions_spec.rb +3 -5
  50. data/spec/fb_graph/connections/television_spec.rb +1 -3
  51. data/spec/fb_graph/connections/test_users_spec.rb +1 -3
  52. data/spec/fb_graph/connections/threads_spec.rb +1 -3
  53. data/spec/fb_graph/connections/videos_spec.rb +1 -3
  54. data/spec/fb_graph/node_spec.rb +31 -28
  55. data/spec/fb_graph/post_spec.rb +2 -6
  56. data/spec/fb_graph/query/core_spec.rb +0 -10
  57. data/spec/fb_graph/test_user_spec.rb +5 -5
  58. data/spec/fb_graph/user_spec.rb +2 -6
  59. data/spec/helpers/webmock_helper.rb +14 -10
  60. data/spec/mock_json/users/home/me_private.json +2 -2
  61. metadata +26 -15
@@ -21,17 +21,20 @@ module WebMockHelper
21
21
  }
22
22
  end
23
23
 
24
- def mock_fql(query, file_path, options = {})
25
- params = {
24
+ def mock_fql(query, response_file, options = {})
25
+ options.merge!(:params => {
26
26
  :query => query,
27
27
  :format => :json
28
- }
29
- params[:access_token] = options[:access_token] if options[:access_token]
30
- stub_request(:get, FbGraph::Query::ENDPOINT).with(:query => params).to_return(
31
- :body => File.read(File.join(File.dirname(__FILE__), '../mock_json', "#{file_path}.json"))
28
+ })
29
+ stub_request(:get, FbGraph::Query::ENDPOINT).with(
30
+ request_for(:get, options)
31
+ ).to_return(
32
+ response_for(response_file)
32
33
  )
33
34
  res = yield
34
- a_request(:get, FbGraph::Query::ENDPOINT).with(:query => params).should have_been_made.once
35
+ a_request(:get, FbGraph::Query::ENDPOINT).with(
36
+ request_for(:get, options)
37
+ ).should have_been_made.once
35
38
  res
36
39
  end
37
40
 
@@ -43,6 +46,10 @@ module WebMockHelper
43
46
 
44
47
  def request_for(method, options = {})
45
48
  request = {}
49
+ if options[:access_token]
50
+ options[:params] ||= {}
51
+ options[:params][:oauth_token] = options[:access_token].to_s
52
+ end
46
53
  if options[:params]
47
54
  case method
48
55
  when :post, :put
@@ -51,9 +58,6 @@ module WebMockHelper
51
58
  request[:query] = options[:params]
52
59
  end
53
60
  end
54
- if options[:headers]
55
- request[:headers] = options[:headers]
56
- end
57
61
  request
58
62
  end
59
63
 
@@ -454,7 +454,7 @@
454
454
  }
455
455
  ],
456
456
  "paging": {
457
- "previous": "https://graph.facebook.com/579612276/home?access_token=2227470867%7C2.WUnvvW0Q_ksjjVOCIEkEiQ__.3600.1272380400-579612276%7CSkfo-M8-vpId32OYv6xLZFlsToY.&limit=25&since=2010-04-27T13%3A06%3A14%2B0000",
458
- "next": "https://graph.facebook.com/579612276/home?access_token=2227470867%7C2.WUnvvW0Q_ksjjVOCIEkEiQ__.3600.1272380400-579612276%7CSkfo-M8-vpId32OYv6xLZFlsToY.&limit=25&until=2010-04-27T11%3A07%3A48%2B0000"
457
+ "previous": "https://graph.facebook.com/579612276/home?access_token=2227470867%7C2.WUnvvW0Q_ksjjVOCIEkEiQ__.3600.1272380400-579612276%7CSkfo-M8-vpId32OYv6xLZFlsToY.&limit=25&since=123456789",
458
+ "next": "https://graph.facebook.com/579612276/home?access_token=2227470867%7C2.WUnvvW0Q_ksjjVOCIEkEiQ__.3600.1272380400-579612276%7CSkfo-M8-vpId32OYv6xLZFlsToY.&limit=25&until=123456789"
459
459
  }
460
460
  }
metadata CHANGED
@@ -1,8 +1,8 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fb_graph
3
3
  version: !ruby/object:Gem::Version
4
- prerelease:
5
- version: 1.7.5
4
+ prerelease: 6
5
+ version: 1.8.0.alpha
6
6
  platform: ruby
7
7
  authors:
8
8
  - nov matake
@@ -10,63 +10,74 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2011-05-11 00:00:00 Z
13
+ date: 2011-05-10 00:00:00 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
- name: rack-oauth2
16
+ name: httpclient
17
17
  prerelease: false
18
18
  requirement: &id001 !ruby/object:Gem::Requirement
19
19
  none: false
20
20
  requirements:
21
21
  - - ">="
22
22
  - !ruby/object:Gem::Version
23
- version: 0.6.5
23
+ version: 2.2.0.2
24
24
  type: :runtime
25
25
  version_requirements: *id001
26
26
  - !ruby/object:Gem::Dependency
27
- name: rake
27
+ name: rack-oauth2
28
28
  prerelease: false
29
29
  requirement: &id002 !ruby/object:Gem::Requirement
30
+ none: false
31
+ requirements:
32
+ - - ">="
33
+ - !ruby/object:Gem::Version
34
+ version: 0.6.9
35
+ type: :runtime
36
+ version_requirements: *id002
37
+ - !ruby/object:Gem::Dependency
38
+ name: rake
39
+ prerelease: false
40
+ requirement: &id003 !ruby/object:Gem::Requirement
30
41
  none: false
31
42
  requirements:
32
43
  - - ">="
33
44
  - !ruby/object:Gem::Version
34
45
  version: "0.8"
35
46
  type: :development
36
- version_requirements: *id002
47
+ version_requirements: *id003
37
48
  - !ruby/object:Gem::Dependency
38
49
  name: rcov
39
50
  prerelease: false
40
- requirement: &id003 !ruby/object:Gem::Requirement
51
+ requirement: &id004 !ruby/object:Gem::Requirement
41
52
  none: false
42
53
  requirements:
43
54
  - - ">="
44
55
  - !ruby/object:Gem::Version
45
56
  version: "0.9"
46
57
  type: :development
47
- version_requirements: *id003
58
+ version_requirements: *id004
48
59
  - !ruby/object:Gem::Dependency
49
60
  name: rspec
50
61
  prerelease: false
51
- requirement: &id004 !ruby/object:Gem::Requirement
62
+ requirement: &id005 !ruby/object:Gem::Requirement
52
63
  none: false
53
64
  requirements:
54
65
  - - ">="
55
66
  - !ruby/object:Gem::Version
56
67
  version: "2"
57
68
  type: :development
58
- version_requirements: *id004
69
+ version_requirements: *id005
59
70
  - !ruby/object:Gem::Dependency
60
71
  name: webmock
61
72
  prerelease: false
62
- requirement: &id005 !ruby/object:Gem::Requirement
73
+ requirement: &id006 !ruby/object:Gem::Requirement
63
74
  none: false
64
75
  requirements:
65
76
  - - ">="
66
77
  - !ruby/object:Gem::Version
67
78
  version: 1.6.2
68
79
  type: :development
69
- version_requirements: *id005
80
+ version_requirements: *id006
70
81
  description: A full-stack Facebook Graph API wrapper in Ruby.
71
82
  email: nov@matake.jp
72
83
  executables: []
@@ -404,9 +415,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
404
415
  required_rubygems_version: !ruby/object:Gem::Requirement
405
416
  none: false
406
417
  requirements:
407
- - - ">="
418
+ - - ">"
408
419
  - !ruby/object:Gem::Version
409
- version: "0"
420
+ version: 1.3.1
410
421
  requirements: []
411
422
 
412
423
  rubyforge_project: