diaspora/spec/models/services/tumblr_spec.rb
Maxwell Salzberg 72c6efe41c basic specs
2011-06-01 22:38:15 -07:00

32 lines
878 B
Ruby

require 'spec_helper'
describe Services::Tumblr do
before do
@user = alice
@post = @user.post(:status_message, :text => "hello", :to =>@user.aspects.first.id)
@service = Services::Tumblr.new(:access_token => "yeah", :access_secret => "foobar")
@user.services << @service
end
describe '#post' do
it 'posts a status message to tumblr' do
OAuth::AccessToken.any_instance.should_receive(:post)
@service.post(@post)
end
it 'swallows exception raised by tumblr not being webscale' do
pending "meh"
OAuth::AccessToken.any_instance.should_receive(:post).and_raise
@service.post(@post)
end
it 'should call public message' do
OAuth::AccessToken.any_instance.stub(:post)
url = "foo"
@service.should_receive(:public_message).with(@post, url)
@service.post(@post, url)
end
end
end