features/step_definitions/http_steps.rb in jakal-0.1.0 vs features/step_definitions/http_steps.rb in jakal-0.1.1
- old
+ new
@@ -7,11 +7,11 @@
end
When /^I request some RSS$/ do
keyphrase = @keyphrase || "iraq"
url = "#{YAML::load_file('config/config.yml')['topix']}#{CGI::escape(keyphrase)}"
- @response = Jkl::get_from_as_xml url
+ @response = Jkl::get_xml_from url
end
Given /^I have some RSS$/ do
raw = File.open('features/mocks/topix_rss.xml','r') {|f| f.readlines.to_s}
@response = Hpricot.XML raw
@@ -26,20 +26,19 @@
twitter_json_url = YAML::load_file('config/config.yml')['twitter']
output = JSON.parse Jkl::get_from twitter_json_url
@response = output['trends']
end
-
Then /^I should get a response$/ do
@response.should_not == nil
#puts @response.inspect
end
Then /^I should receive some headlines$/ do
- @items = Jkl::get_items_from @response
+ @items = Jkl::Rss::items @response
@links = []
@items.each do |item|
- @links << Jkl::attribute_from(item, :link)
+ @links << Jkl::Rss::attribute_from(item, :link)
end
@links.should_not == nil
@links.length.should > 0
end