Sha256: e8744f14dce65a9361e5aafd5425ed6ae62d1d2f0b1fc53cdbd55117be7ca180

Contents?: true

Size: 823 Bytes

Versions: 1

Compression:

Stored size: 823 Bytes

Contents

require 'spec_helper'

describe 'Item' do
  before do
    feed_uri = File.expand_path(File.dirname(__FILE__) + '/data/feed.rss')
    feed = Feed2Mail::Feed.new feed_uri
    @item_0 = feed.items[0]
    @item_1 = feed.items[1]
  end

  context '#new' do
    it 'has an URI when created' do
      @item_0.uri.should == 'http://feed-sample.example.net/item/1'
    end

    it 'has a title when created' do
      @item_0.title.should == 'Item 1 title'
    end

    it 'has a description when created' do
      @item_0.description.should == 'Item 1 description'
    end
  end

  context 'entities' do
    it 'convert in title' do
      @item_1.title.should == 'Item 2 title « & »'
    end

    it 'convert in description' do
      @item_1.description.should == 'Item 2 description with entity « test »'
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
feed2mail-0.0.1 spec/item_spec.rb