Sha256: 3b4d6436a39381894c73e908aec1c4c2e844b46e80fea03ea0d2c6b7faa83034

Contents?: true

Size: 728 Bytes

Versions: 1

Compression:

Stored size: 728 Bytes

Contents

# -*- coding: utf-8 -*-
require 'spec_helper'

describe Courier::Service::Facebook do
  describe '#deliver!' do
    it 'posts messages with Koala' do
      owner = mock_owner :facebook_token=>'fbtoken'

      message = mock_message :owner=>owner, :options=>{:text=>'text',:attachment=>{},:to=>'123'}
      message.should_receive(:owner)
      message.should_receive(:set_delivered)

      graph = double
      graph.should_receive(:put_wall_post).
        with(message.options[:text], message.options[:attachment], message.options[:to]) { true }
      Koala::Facebook::GraphAPI.should_receive(:new).with('fbtoken') { graph }

      subject.stub_chain('messages.fresh') { [message] }
      subject.deliver_all!
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
courier-0.1.3 spec/courier/service/facebook_spec.rb