Skip to content

Commit

Permalink
fixed problem where the atom entry urls would sometimes not get parse…
Browse files Browse the repository at this point in the history
…d out
  • Loading branch information
pauldix committed Jul 15, 2009
1 parent 667c584 commit 79048d6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/feedzirra/parser/atom_entry.rb
Expand Up @@ -27,6 +27,11 @@ class AtomEntry
element :updated
element :modified, :as => :updated
elements :category, :as => :categories, :value => :term
elements :link, :as => :links, :value => :href

def url
@url || links.first
end
end

end
Expand Down
4 changes: 4 additions & 0 deletions spec/feedzirra/parser/atom_entry_spec.rb
Expand Up @@ -15,6 +15,10 @@
@entry.url.should == "http://aws.typepad.com/aws/2009/01/aws-job-architect-designer-position-in-turkey.html"
end

it "should parse the url even when" do
Feedzirra::Parser::Atom.parse(load_sample("atom_with_link_tag_for_url_unmarked.xml")).entries.first.url.should == "http://www.innoq.com/blog/phaus/2009/07/ja.html"
end

it "should parse the author" do
@entry.author.should == "AWS Editor"
end
Expand Down

0 comments on commit 79048d6

Please sign in to comment.