Sha256: 1c76520cf3f48c014761aca8a036ec956be792432cec4b1eea93659dfd373640

Contents?: true

Size: 1.04 KB

Versions: 3

Compression:

Stored size: 1.04 KB

Contents

require File.join(File.dirname(__FILE__), "/../spec_helper")

describe RssEntryToTwogPostMapper do
  include RssEntryToTwogPostMapper

  it "should convert rss entries that have updated.content and link.href" do
    updated = double('update', content: '2010-04-02T01:00:00-06:00')
    link = double('link', href: 'http://tinyurl.com')
    post = double('post', updated: updated, link: link)

    posts = (0..20).collect { |x| post }

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

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

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

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
twog-0.3.5 spec/twog/rss_entry_to_twog_post_mapper_spec.rb
twog-0.3.4 spec/twog/rss_entry_to_twog_post_mapper_spec.rb
twog-0.3.3 spec/twog/rss_entry_to_twog_post_mapper_spec.rb