Using a JSON file with FakeWeb
View as text
FakeWeb.register_uri(:get, "http://search.twitter.com:80/search.json?q=#{keyword}",
:string => JSON.parse(File.new("#{RAILS_ROOT}/test/files/search/#{keyword}.json").read))
FakeWeb.register_uri(:get, "http://search.twitter.com:80/search.json?q=#{keyword}",
:string => JSON.parse(File.new("#{RAILS_ROOT}/test/files/search/#{keyword}.json").read))
SnippetStash costs money to host and develop. The service is free for everyone to use
but if you found it useful please consider making a small donation.