Displaying 1 result from an estimated 1 matches for "prepare_and_sav".
Did you mean:
prepare_and_save
2008 May 27
2
Help with Writing Meaningful Specs
...ting the contents of the URL and then
passing this into another model to prepare and save it.
def self.cache_all
feeds = self.find(:all)
for feed in feeds
xml = REXML::Document.new Net::HTTP.get(URI.parse(feed.url))
xml.elements.each ''//item'' do |item|
Item.prepare_and_save(feed, item)
end
end
end
Problems are now beginning to arise when trying to write the specs for this
method. I started from scratch slowly building up the specs but it has led
to an awful amount of mocks and stubs, and I am not even sure whether they
are asking the correct things of the meth...