Sha256: e427aa3b8b2303ff35d991dec5425c1a508e2aaaf710ea66a28830cf2d024aa3

Contents?: true

Size: 709 Bytes

Versions: 37

Compression:

Stored size: 709 Bytes

Contents

require 'spec_helper'

describe FbGraph::Connections::AppNotifications do
  let(:app) do
    _app_ = FbGraph::Application.new('app_id', :secret => 'app_secret')
    _app_.should_receive(:get_access_token).and_return(
      Rack::OAuth2::AccessToken::Legacy.new(:access_token => 'app_access_token')
    )
    _app_
  end

  describe '#notify!' do
    it 'should return success json' do
      mock_graph :post, 'matake/notifications', 'success', :params => {
        :template => 'hello'
      }, :access_token => 'app_access_token' do
        user = FbGraph::User.new('matake')
        response = app.notify! user, :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/app_notifications_spec.rb
fb_graph-2.7.16 spec/fb_graph/connections/app_notifications_spec.rb
fb_graph-2.7.15 spec/fb_graph/connections/app_notifications_spec.rb
fb_graph-2.7.14 spec/fb_graph/connections/app_notifications_spec.rb
fb_graph-2.7.13 spec/fb_graph/connections/app_notifications_spec.rb
fb_graph-2.7.12 spec/fb_graph/connections/app_notifications_spec.rb
fb_graph-2.7.11 spec/fb_graph/connections/app_notifications_spec.rb
fb_graph-2.7.10 spec/fb_graph/connections/app_notifications_spec.rb
fb_graph-2.7.9 spec/fb_graph/connections/app_notifications_spec.rb
fb_graph-2.7.8 spec/fb_graph/connections/app_notifications_spec.rb
fb_graph-2.7.7 spec/fb_graph/connections/app_notifications_spec.rb
fb_graph-2.7.6 spec/fb_graph/connections/app_notifications_spec.rb
fb_graph-2.7.5 spec/fb_graph/connections/app_notifications_spec.rb
fb_graph-2.7.4 spec/fb_graph/connections/app_notifications_spec.rb
fb_graph-2.7.3 spec/fb_graph/connections/app_notifications_spec.rb
fb_graph-2.7.2 spec/fb_graph/connections/app_notifications_spec.rb
fb_graph-2.7.1 spec/fb_graph/connections/app_notifications_spec.rb
fb_graph-2.7.0 spec/fb_graph/connections/app_notifications_spec.rb
fb_graph-2.6.7 spec/fb_graph/connections/app_notifications_spec.rb
fb_graph-2.6.6 spec/fb_graph/connections/app_notifications_spec.rb