spec/courier/service/facebook_spec.rb in courier-0.1.3 vs spec/courier/service/facebook_spec.rb in courier-0.1.4
- old
+ new
@@ -4,16 +4,15 @@
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)
+ message = mock_message :owner=>owner, :options=>{:text=>'text'}
+ message.should_receive(:mark_as_delivered!)
graph = double
- graph.should_receive(:put_wall_post).
- with(message.options[:text], message.options[:attachment], message.options[:to]) { true }
+ graph.should_receive(:put_object).
+ with('me','feed',{:message=>'text'}) { true }
Koala::Facebook::GraphAPI.should_receive(:new).with('fbtoken') { graph }
subject.stub_chain('messages.fresh') { [message] }
subject.deliver_all!
end