Sha256: 99cd5d68b33100f0d1cce1db04bdd066415625a9909cb307b26723c3628d992f

Contents?: true

Size: 1.03 KB

Versions: 29

Compression:

Stored size: 1.03 KB

Contents

require 'spec_helper'

describe FbGraph2::Edge::Notifications do
  context 'included in User' do
    describe '#notifications' do
      let(:me) { FbGraph2::User.me('token') }
      it 'should return an Array of FbGraph2::Notification' do
        notifications = mock_graph :get, 'me/notifications', 'user/notifications', access_token: 'token' do
          me.notifications
        end
        notifications.should be_instance_of FbGraph2::Edge
        notifications.should_not be_blank
        notifications.each do |notification|
          notification.should be_instance_of FbGraph2::Notification
        end
      end
    end

    describe '#notification!' do
      let(:user) { FbGraph2::User.new('user_id') }
      it 'should return true' do
        mock_graph :post, 'user_id/notifications', 'success_true', access_token: 'app_token', params: {
          href: 'href', template: 'template'
        } do
          user.authenticate('app_token').notification! href: 'href', template: 'template'
        end.should be true
      end
    end
  end
end

Version data entries

29 entries across 29 versions & 1 rubygems

Version Path
fb_graph2-0.8.0 spec/fb_graph2/edge/notifications_spec.rb
fb_graph2-0.7.9 spec/fb_graph2/edge/notifications_spec.rb
fb_graph2-0.7.8 spec/fb_graph2/edge/notifications_spec.rb
fb_graph2-0.7.7 spec/fb_graph2/edge/notifications_spec.rb
fb_graph2-0.7.6 spec/fb_graph2/edge/notifications_spec.rb
fb_graph2-0.7.5 spec/fb_graph2/edge/notifications_spec.rb
fb_graph2-0.7.4 spec/fb_graph2/edge/notifications_spec.rb
fb_graph2-0.7.3 spec/fb_graph2/edge/notifications_spec.rb
fb_graph2-0.7.2 spec/fb_graph2/edge/notifications_spec.rb
fb_graph2-0.7.1 spec/fb_graph2/edge/notifications_spec.rb
fb_graph2-0.7.0 spec/fb_graph2/edge/notifications_spec.rb
fb_graph2-0.6.2 spec/fb_graph2/edge/notifications_spec.rb
fb_graph2-0.6.1 spec/fb_graph2/edge/notifications_spec.rb
fb_graph2-0.6.0 spec/fb_graph2/edge/notifications_spec.rb
fb_graph2-0.5.3 spec/fb_graph2/edge/notifications_spec.rb
fb_graph2-0.5.2 spec/fb_graph2/edge/notifications_spec.rb
fb_graph2-0.5.1 spec/fb_graph2/edge/notifications_spec.rb
fb_graph2-0.5.0 spec/fb_graph2/edge/notifications_spec.rb
fb_graph2-0.4.4 spec/fb_graph2/edge/notifications_spec.rb
fb_graph2-0.4.3 spec/fb_graph2/edge/notifications_spec.rb