Sha256: da9b72042397a9d62ad67b6e91db03cf7d38ebf27d233d67d3bb5c872dcbd62d

Contents?: true

Size: 648 Bytes

Versions: 1

Compression:

Stored size: 648 Bytes

Contents

require 'spec_helper'

describe GovernorTwitter do
  it "registers the plugin with Governor" do
    Governor::PluginManager.plugins.size == 1
  end
  
  it "registers a job with GovernorBackground" do
    GovernorBackground.retrieve('twitter_post').should_not be_blank
  end
  
  it "can post to twitter" do
    content = "Visit my site!"
    url = 'http://blago.gov/money_please'
    shortened_url = 'http://bit.ly/short'
    Shortie::Service.find_by_key("bitly").expects(:shorten).with(url).returns(shortened_url)
    Twitter.expects(:update).with("#{content} #{shortened_url}")
    GovernorBackground.run('twitter_post', content, url)
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
governor_twitter-0.1.2 spec/governor_twitter_spec.rb