spec/feed_spec.rb in atom-tools-2.0.4 vs spec/feed_spec.rb in atom-tools-2.0.5

- old
+ new

@@ -1,10 +1,10 @@ require File.dirname(__FILE__) + '/spec_helper' require 'atom/feed' -describe Atom::Entry do +describe Atom::Feed do describe 'extensions' do before(:each) do @feed = Atom::Feed.parse(fixtures('feed-w-ext')) end @@ -15,6 +15,25 @@ feed2.merge! @feed feed2.to_s.should =~ /purl/ end end + + before :each do + @feed = Atom::Feed.parse(fixtures('contacts-feed')) + end + + describe "to_s" do + it "should only have one content element" do + result = @feed.to_s + result.scan("<content type=").size.should == 1 + end + end + + describe "to_xml" do + it "should only have one content element" do + result = @feed.to_xml + REXML::XPath.match(result, "//content").size.should == 1 + end + end + end