mirror of
https://github.com/nov/fb_graph2
synced 2023-03-27 23:22:15 -04:00
User#applications spec
This commit is contained in:
parent
194039cd1a
commit
08b290c3ef
2 changed files with 36 additions and 0 deletions
20
spec/fb_graph2/edge/applications_spec.rb
Normal file
20
spec/fb_graph2/edge/applications_spec.rb
Normal file
|
@ -0,0 +1,20 @@
|
|||
require 'spec_helper'
|
||||
|
||||
describe FbGraph2::Edge::Applications do
|
||||
context 'included in User' do
|
||||
let(:me) { FbGraph2::User.me('token') }
|
||||
|
||||
describe '#applications' do
|
||||
it 'should return an Array of FbGraph2::App' do
|
||||
apps = mock_graph :get, 'me/applications/developer', 'user/applications', access_token: 'token' do
|
||||
me.applications
|
||||
end
|
||||
apps.should be_instance_of FbGraph2::Edge
|
||||
apps.should_not be_blank
|
||||
apps.each do |app|
|
||||
app.should be_instance_of FbGraph2::App
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
16
spec/mock_json/user/applications.json
Normal file
16
spec/mock_json/user/applications.json
Normal file
|
@ -0,0 +1,16 @@
|
|||
{
|
||||
"data": [{
|
||||
"name": "gem sample",
|
||||
"namespace": "gem-sample",
|
||||
"id": "210798282372757"
|
||||
}, {
|
||||
"name": "Localhost",
|
||||
"id": "158245434257042"
|
||||
}, {
|
||||
"name": "OAuth.jp",
|
||||
"id": "126213067419995"
|
||||
}],
|
||||
"paging": {
|
||||
"next": "https://graph.facebook.com/v2.1/579612276/applications?type=developer&limit=25&offset=25&__after_id=***"
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue