Sha256: b6dd52b69e4f55de0d870386ff098a5c3e60521436c8c5d183bfd53f32f9ccf0
Contents?: true
Size: 1.55 KB
Versions: 4
Compression:
Stored size: 1.55 KB
Contents
require 'spec_helper' describe FbGraph::Connections::Subscriptions, '#subscriptions' do context 'when included by FbGraph::Application' do context 'when access_token is given' do it 'should return liked pages as FbGraph::Page' do mock_graph :get, 'fb_graph/subscriptions', 'applications/subscriptions/fb_graph_private', :params => { :access_token => 'access_token' } do subscriptions = FbGraph::Application.new('fb_graph', :access_token => 'access_token').subscriptions subscriptions.each do |subscription| subscription.should be_instance_of(FbGraph::Subscription) end end end end end end describe FbGraph::Connections::Subscriptions, '#subscribe!' do before do @app = FbGraph::Application.new('fb_graph', :access_token => 'access_token') end it 'should POST to /:app_id/subscriptions' do lambda do @app.subscribe!( :object => "user", :fields => "name,email", :callback_url => "http://fbgraphsample.heroku.com/subscription", :verify_token => "Define by yourself" ) end.should request_to 'fb_graph/subscriptions', :post end end describe FbGraph::Connections::Subscriptions, '#unsubscribe!' do before do @app = FbGraph::Application.new('fb_graph', :access_token => 'access_token') end it 'should DELETE /:app_id/subscriptions' do lambda do @app.unsubscribe!( :object => 'user' ) end.should request_to 'fb_graph/subscriptions?access_token=access_token&object=user', :delete end end
Version data entries
4 entries across 4 versions & 1 rubygems