Sham.define do sourcename { Faker::Name.name } sourcefeed { 'http://' + Faker::Internet.domain_name } title { Faker::Lorem.sentence(word_count = 10) } author { Faker::Name.name } summary { Faker::Lorem.sentences(sentence_count = 5).join(' ') } content { Faker::Lorem.sentences(sentence_count = 20).join(' ') } time_in_past { random_date_in_past(:year_range => 3) } guid { Faker::Internet.user_name * 5 } pretty_content { File.open("#{File.dirname(__FILE__)}/infosources_files/pretty.html").read } ugly_content { File.open("#{File.dirname(__FILE__)}/infosources_files/ugly.html").read } end Infosource.blueprint do sourcename sourcefeed end require 'feedzirra/feed_entry_utilities' class FeedEntry include Feedzirra::FeedEntryUtilities attr_accessor :title attr_accessor :author attr_accessor :summary attr_accessor :content attr_accessor :url attr_accessor :published attr_accessor :id end FeedEntry.blueprint do title author summary content url published { Sham.time_in_past } id { Sham.guid } end FeedEntry.blueprint(:known_source) do url { 'http://www.pretty.url/' + Faker::Internet.domain_word } content { nil } end FeedEntry.blueprint(:no_content_xpath) do url { 'http://www.skipped.url/' + Faker::Internet.domain_word } end