Sha256: 8c29794731959091213bcce5a46f28700cfb37f04634935d3b609170aa437ef9

Contents?: true

Size: 1013 Bytes

Versions: 37

Compression:

Stored size: 1013 Bytes

Contents

require 'spec_helper'

describe FbGraph::Connections::Notifications do
  describe '#notifications' do
    it 'should return notifications as FbGraph::Notification' do
      mock_graph :get, 'me/notifications', 'users/notifications/all', :params => {
        :include_read => 'true'
      }, :access_token => 'access_token' do
        notifications = FbGraph::User.me('access_token').notifications(:include_read => true)
        notifications.each do |notification|
          notification.should be_instance_of FbGraph::Notification
        end
      end
    end
  end

  describe '#notification!' do
    it 'should return success json' do
      mock_graph :post, 'matake/notifications', 'success', :params => {
        :template => 'hello'
      }, :access_token => 'app_access_token' do
        response = FbGraph::User.new('matake').notification!(
          :access_token => 'app_access_token',
          :template => 'hello'
        )
        response.should == {'success' => true}
      end
    end
  end
end

Version data entries

37 entries across 37 versions & 1 rubygems

Version Path
fb_graph-2.7.17 spec/fb_graph/connections/notifications_spec.rb
fb_graph-2.7.16 spec/fb_graph/connections/notifications_spec.rb
fb_graph-2.7.15 spec/fb_graph/connections/notifications_spec.rb
fb_graph-2.7.14 spec/fb_graph/connections/notifications_spec.rb
fb_graph-2.7.13 spec/fb_graph/connections/notifications_spec.rb
fb_graph-2.7.12 spec/fb_graph/connections/notifications_spec.rb
fb_graph-2.7.11 spec/fb_graph/connections/notifications_spec.rb
fb_graph-2.7.10 spec/fb_graph/connections/notifications_spec.rb
fb_graph-2.7.9 spec/fb_graph/connections/notifications_spec.rb
fb_graph-2.7.8 spec/fb_graph/connections/notifications_spec.rb
fb_graph-2.7.7 spec/fb_graph/connections/notifications_spec.rb
fb_graph-2.7.6 spec/fb_graph/connections/notifications_spec.rb
fb_graph-2.7.5 spec/fb_graph/connections/notifications_spec.rb
fb_graph-2.7.4 spec/fb_graph/connections/notifications_spec.rb
fb_graph-2.7.3 spec/fb_graph/connections/notifications_spec.rb
fb_graph-2.7.2 spec/fb_graph/connections/notifications_spec.rb
fb_graph-2.7.1 spec/fb_graph/connections/notifications_spec.rb
fb_graph-2.7.0 spec/fb_graph/connections/notifications_spec.rb
fb_graph-2.6.7 spec/fb_graph/connections/notifications_spec.rb
fb_graph-2.6.6 spec/fb_graph/connections/notifications_spec.rb