fb_graph 2.4.19 → 2.4.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/Gemfile.lock +17 -18
- data/README.rdoc +2 -2
- data/VERSION +1 -1
- data/lib/fb_graph/application.rb +1 -0
- data/lib/fb_graph/connections/app_notifications.rb +10 -0
- data/lib/fb_graph/connections/notifications.rb +4 -0
- data/lib/fb_graph/node.rb +1 -0
- data/spec/fb_graph/connections/app_notifications_spec.rb +23 -0
- data/spec/fb_graph/connections/notifications_spec.rb +14 -0
- data/spec/mock_json/success.json +1 -0
- metadata +7 -2
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
fb_graph (2.4.
|
4
|
+
fb_graph (2.4.19)
|
5
5
|
httpclient (>= 2.2.0.2)
|
6
6
|
rack-oauth2 (>= 0.14.4)
|
7
7
|
tzinfo
|
@@ -9,23 +9,23 @@ PATH
|
|
9
9
|
GEM
|
10
10
|
remote: http://rubygems.org/
|
11
11
|
specs:
|
12
|
-
actionpack (3.2.
|
13
|
-
activemodel (= 3.2.
|
14
|
-
activesupport (= 3.2.
|
12
|
+
actionpack (3.2.8)
|
13
|
+
activemodel (= 3.2.8)
|
14
|
+
activesupport (= 3.2.8)
|
15
15
|
builder (~> 3.0.0)
|
16
16
|
erubis (~> 2.7.0)
|
17
|
-
journey (~> 1.0.
|
17
|
+
journey (~> 1.0.4)
|
18
18
|
rack (~> 1.4.0)
|
19
19
|
rack-cache (~> 1.2)
|
20
20
|
rack-test (~> 0.6.1)
|
21
21
|
sprockets (~> 2.1.3)
|
22
|
-
activemodel (3.2.
|
23
|
-
activesupport (= 3.2.
|
22
|
+
activemodel (3.2.8)
|
23
|
+
activesupport (= 3.2.8)
|
24
24
|
builder (~> 3.0.0)
|
25
|
-
activesupport (3.2.
|
25
|
+
activesupport (3.2.8)
|
26
26
|
i18n (~> 0.6)
|
27
27
|
multi_json (~> 1.0)
|
28
|
-
addressable (2.2
|
28
|
+
addressable (2.3.2)
|
29
29
|
attr_required (0.0.5)
|
30
30
|
builder (3.0.0)
|
31
31
|
configatron (2.9.1)
|
@@ -38,20 +38,19 @@ GEM
|
|
38
38
|
erubis (2.7.0)
|
39
39
|
hashie (1.2.0)
|
40
40
|
hike (1.2.1)
|
41
|
-
httpclient (2.2.
|
42
|
-
i18n (0.6.
|
41
|
+
httpclient (2.2.7)
|
42
|
+
i18n (0.6.1)
|
43
43
|
journey (1.0.4)
|
44
|
-
json (1.7.3)
|
45
44
|
multi_json (1.3.6)
|
46
45
|
rack (1.4.1)
|
47
46
|
rack-cache (1.2)
|
48
47
|
rack (>= 0.4)
|
49
|
-
rack-oauth2 (0.14.
|
48
|
+
rack-oauth2 (0.14.9)
|
50
49
|
activesupport (>= 2.3)
|
51
50
|
attr_required (>= 0.0.5)
|
52
51
|
httpclient (>= 2.2.0.2)
|
53
52
|
i18n
|
54
|
-
|
53
|
+
multi_json (>= 1.3.6)
|
55
54
|
rack (>= 1.1)
|
56
55
|
rack-test (0.6.1)
|
57
56
|
rack (>= 1.0)
|
@@ -60,17 +59,17 @@ GEM
|
|
60
59
|
rspec-core (~> 2.11.0)
|
61
60
|
rspec-expectations (~> 2.11.0)
|
62
61
|
rspec-mocks (~> 2.11.0)
|
63
|
-
rspec-core (2.11.
|
64
|
-
rspec-expectations (2.11.
|
62
|
+
rspec-core (2.11.1)
|
63
|
+
rspec-expectations (2.11.2)
|
65
64
|
diff-lcs (~> 1.1.3)
|
66
|
-
rspec-mocks (2.11.
|
65
|
+
rspec-mocks (2.11.2)
|
67
66
|
sprockets (2.1.3)
|
68
67
|
hike (~> 1.2)
|
69
68
|
rack (~> 1.0)
|
70
69
|
tilt (~> 1.1, != 1.3.0)
|
71
70
|
tilt (1.3.3)
|
72
71
|
tzinfo (0.3.33)
|
73
|
-
webmock (1.8.
|
72
|
+
webmock (1.8.9)
|
74
73
|
addressable (>= 2.2.7)
|
75
74
|
crack (>= 0.1.7)
|
76
75
|
yamler (0.1.0)
|
data/README.rdoc
CHANGED
@@ -150,8 +150,8 @@ https://github.com/nov/fb_graph/wiki
|
|
150
150
|
me = FbGraph::User.me(ACCESS_TOKEN)
|
151
151
|
event = me.event!(
|
152
152
|
:name => 'FbGraph test event',
|
153
|
-
:start_time => 1.week.from_now
|
154
|
-
:end_time => 2.week.from_now
|
153
|
+
:start_time => 1.week.from_now,
|
154
|
+
:end_time => 2.week.from_now
|
155
155
|
)
|
156
156
|
bool = event.attending!(
|
157
157
|
:access_token => ACCESS_TOKEN
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.4.
|
1
|
+
2.4.20
|
data/lib/fb_graph/application.rb
CHANGED
data/lib/fb_graph/node.rb
CHANGED
@@ -0,0 +1,23 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe FbGraph::Connections::AppNotifications do
|
4
|
+
let(:app) do
|
5
|
+
_app_ = FbGraph::Application.new('app_id', :secret => 'app_secret')
|
6
|
+
_app_.should_receive(:get_access_token).and_return(
|
7
|
+
Rack::OAuth2::AccessToken::Legacy.new(:access_token => 'app_access_token')
|
8
|
+
)
|
9
|
+
_app_
|
10
|
+
end
|
11
|
+
|
12
|
+
describe '#notify!' do
|
13
|
+
it 'should return success json' do
|
14
|
+
mock_graph :post, 'matake/notifications', 'success', :params => {
|
15
|
+
:template => 'hello'
|
16
|
+
}, :access_token => 'app_access_token' do
|
17
|
+
user = FbGraph::User.new('matake')
|
18
|
+
response = app.notify! user, :template => 'hello'
|
19
|
+
response.should == {'success' => true}
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -13,4 +13,18 @@ describe FbGraph::Connections::Notifications do
|
|
13
13
|
end
|
14
14
|
end
|
15
15
|
end
|
16
|
+
|
17
|
+
describe '#notification!' do
|
18
|
+
it 'should return success json' do
|
19
|
+
mock_graph :post, 'matake/notifications', 'success', :params => {
|
20
|
+
:template => 'hello'
|
21
|
+
}, :access_token => 'app_access_token' do
|
22
|
+
response = FbGraph::User.new('matake').notification!(
|
23
|
+
:access_token => 'app_access_token',
|
24
|
+
:template => 'hello'
|
25
|
+
)
|
26
|
+
response.should == {'success' => true}
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
16
30
|
end
|
@@ -0,0 +1 @@
|
|
1
|
+
{"success": true}
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fb_graph
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.4.
|
4
|
+
version: 2.4.20
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-09-02 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: httpclient
|
@@ -199,6 +199,7 @@ files:
|
|
199
199
|
- lib/fb_graph/connections/ad_previews.rb
|
200
200
|
- lib/fb_graph/connections/admins.rb
|
201
201
|
- lib/fb_graph/connections/albums.rb
|
202
|
+
- lib/fb_graph/connections/app_notifications.rb
|
202
203
|
- lib/fb_graph/connections/app_requests.rb
|
203
204
|
- lib/fb_graph/connections/attending.rb
|
204
205
|
- lib/fb_graph/connections/banned.rb
|
@@ -357,6 +358,7 @@ files:
|
|
357
358
|
- spec/fb_graph/connections/ad_previews_spec.rb
|
358
359
|
- spec/fb_graph/connections/admins_spec.rb
|
359
360
|
- spec/fb_graph/connections/albums_spec.rb
|
361
|
+
- spec/fb_graph/connections/app_notifications_spec.rb
|
360
362
|
- spec/fb_graph/connections/app_requests_spec.rb
|
361
363
|
- spec/fb_graph/connections/attending_spec.rb
|
362
364
|
- spec/fb_graph/connections/banned_spec.rb
|
@@ -590,6 +592,7 @@ files:
|
|
590
592
|
- spec/mock_json/questions/options/matake_private.json
|
591
593
|
- spec/mock_json/questions/options/votes/matake_private.json
|
592
594
|
- spec/mock_json/statuses/with_likes.json
|
595
|
+
- spec/mock_json/success.json
|
593
596
|
- spec/mock_json/thread/former_participants/private.json
|
594
597
|
- spec/mock_json/thread/messages/created.json
|
595
598
|
- spec/mock_json/thread/messages/private.json
|
@@ -737,6 +740,7 @@ test_files:
|
|
737
740
|
- spec/fb_graph/connections/ad_previews_spec.rb
|
738
741
|
- spec/fb_graph/connections/admins_spec.rb
|
739
742
|
- spec/fb_graph/connections/albums_spec.rb
|
743
|
+
- spec/fb_graph/connections/app_notifications_spec.rb
|
740
744
|
- spec/fb_graph/connections/app_requests_spec.rb
|
741
745
|
- spec/fb_graph/connections/attending_spec.rb
|
742
746
|
- spec/fb_graph/connections/banned_spec.rb
|
@@ -970,6 +974,7 @@ test_files:
|
|
970
974
|
- spec/mock_json/questions/options/matake_private.json
|
971
975
|
- spec/mock_json/questions/options/votes/matake_private.json
|
972
976
|
- spec/mock_json/statuses/with_likes.json
|
977
|
+
- spec/mock_json/success.json
|
973
978
|
- spec/mock_json/thread/former_participants/private.json
|
974
979
|
- spec/mock_json/thread/messages/created.json
|
975
980
|
- spec/mock_json/thread/messages/private.json
|