Sha256: 3e411f86a8d5a6b5f7154f47d2e7b48fd494e9ed03e5f70271d31f14af12f5b9

Contents?: true

Size: 1.02 KB

Versions: 1

Compression:

Stored size: 1.02 KB

Contents

require File.dirname(__FILE__) + "/spec_helper"

describe Twog::RssEntryToTwogPostMapper do
  include Twog::RssEntryToTwogPostMapper

  it "should convert rss entries that have updated.content and link.href" do
    updated = stub('update', :content => '2010-04-02T01:00:00-06:00')
    link = stub('link', :href => 'http://tinyurl.com')
    post = stub('post', :updated => updated, :link => link)
    
    posts = (0..20).collect { |x| post }

    twog_posts = map(posts)
    twog_posts.length.should == 21
    twog_posts.each do |p|
      p.date.should == "2010-04-02T01:00:00-06:00"
      p.link.should == "http://tinyurl.com"
    end
  end

  it "should convert rss entries that have pubDate and link" do
    post = stub('post', :pubDate => '2010-04-02T01:00:00-06:00', :link => 'http://tinyurl.com')
    posts = (0..20).collect { |x| post }

    twog_posts = map(posts)
    twog_posts.length.should == 21
    twog_posts.each do |p|
      p.date.should == "2010-04-02T01:00:00-06:00"
      p.link.should == "http://tinyurl.com"
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
twog-0.3.1 spec/rss_entry_to_twog_post_mapper_spec.rb