Skip to content

Commit

Permalink
all tests now running off json & Fakeweb instead of yaml files
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Croak committed Jun 30, 2009
1 parent c409842 commit 33a935f
Show file tree
Hide file tree
Showing 23 changed files with 469 additions and 67 deletions.
2 changes: 1 addition & 1 deletion test/foreign_languages_test.rb
@@ -1,7 +1,7 @@
require File.join(File.dirname(__FILE__), 'test_helper')

class ForeignLanguagesTest < Test::Unit::TestCase # :nodoc:
context "client.query(:q => 'congratulations', :lang => 'en')" do
context "english" do
setup do
query = { :q => 'congratulations', :lang => 'en' }
fake_query(query, 'english.json')
Expand Down
20 changes: 20 additions & 0 deletions test/json/beer_minus_root.json
@@ -0,0 +1,20 @@
HTTP/1.1 200 OK
Date: Tue, 30 Jun 2009 15:04:54 GMT
Server: hi
Status: 200 OK
X-Served-From: searchdb003
X-Timeline-Cache-Hit: Miss
Cache-Control: max-age=60, must-revalidate, max-age=300
Content-Type: application/json; charset=utf-8
X-Served-By: searchweb003.twitter.com
Expires: Tue, 30 Jun 2009 15:09:54 GMT
Content-Length: 7034
Vary: Accept-Encoding
X-Varnish: 1887432816
Age: 0
Via: 1.1 varnish
X-Cache-Svr: searchweb003.twitter.com
X-Cache: MISS
Connection: close

{"results":[{"text":"R, home sweet home. Without any further a do, I gonna try some of my home made beer. Today's the day it's ready.","to_user_id":null,"from_user":"eco_retro","id":2404598347,"from_user_id":16300155,"iso_language_code":"en","source":"&lt;a href=&quot;http:\/\/www.twhirl.org\/&quot;&gt;twhirl&lt;\/a&gt;","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/252066475\/tweetpic2_normal.jpg","created_at":"Tue, 30 Jun 2009 15:04:40 +0000"},{"text":"@ellaabi Once there's beer n stuff.","to_user_id":25168640,"to_user":"ellaabi","from_user":"larjudge","id":2404596615,"from_user_id":11806192,"iso_language_code":"en","source":"&lt;a href=&quot;http:\/\/www.tweetdeck.com\/&quot;&gt;TweetDeck&lt;\/a&gt;","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/196419446\/avtr_normal.jpg","created_at":"Tue, 30 Jun 2009 15:04:33 +0000"},{"text":"@ya_ko thanks! yeah, let's go for some cold beer!","to_user_id":5375,"to_user":"Ya_ko","from_user":"nealsato","id":2404596156,"from_user_id":173501,"iso_language_code":"en","source":"&lt;a href=&quot;http:\/\/desktop.seesmic.com\/&quot;&gt;Seesmic Desktop&lt;\/a&gt;","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/52108672\/neal_normal.jpg","created_at":"Tue, 30 Jun 2009 15:04:31 +0000"},{"text":"Support Finnegans.org by their beer","to_user_id":null,"from_user":"InternetJunkee","id":2404594754,"from_user_id":24711327,"iso_language_code":"en","source":"&lt;a href=&quot;http:\/\/twitter.com\/&quot;&gt;web&lt;\/a&gt;","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/134891444\/Me_1_normal.JPG","created_at":"Tue, 30 Jun 2009 15:04:25 +0000"},{"text":"@ReeseLP Yea homie it was ROUGH beer pong all night I was ALLEN IVERSON SON!! LOL","to_user_id":9820644,"to_user":"ReeseLP","from_user":"TheeKoolestKid","id":2404591401,"from_user_id":18162717,"iso_language_code":"en","source":"&lt;a href=&quot;http:\/\/twitter.com\/&quot;&gt;web&lt;\/a&gt;","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/223913615\/WORD_normal.jpg","created_at":"Tue, 30 Jun 2009 15:04:11 +0000"},{"text":"Long and hot day at work. Going for a cold beer now!","to_user_id":null,"from_user":"Dyppe","id":2404590897,"from_user_id":4756705,"iso_language_code":"en","source":"&lt;a href=&quot;http:\/\/twitter.com\/&quot;&gt;web&lt;\/a&gt;","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/79704489\/recut_normal.jpg","created_at":"Tue, 30 Jun 2009 15:04:09 +0000"},{"text":"@browntown big beer holiday so no bars 2day mainly grocery &amp; conv. stores","to_user_id":409097,"to_user":"browntown","from_user":"djacra","id":2404590895,"from_user_id":13510637,"iso_language_code":"en","source":"&lt;a href=&quot;http:\/\/twitterhelp.blogspot.com\/2008\/05\/twitter-via-mobile-web-mtwittercom.html&quot;&gt;mobile web&lt;\/a&gt;","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/180129385\/Venice_66_256_normal.JPG","created_at":"Tue, 30 Jun 2009 15:04:09 +0000"},{"text":"Just left @statuz home because he has more important things to do (saving teh world from evil ninjas) on my way to more trance and beer!","to_user_id":null,"from_user":"Trance_Cat","id":2404589416,"from_user_id":15859610,"iso_language_code":"en","source":"&lt;a href=&quot;http:\/\/twitterfon.net\/&quot;&gt;TwitterFon&lt;\/a&gt;","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/141213693\/Begging_normal.jpg","created_at":"Tue, 30 Jun 2009 15:04:03 +0000"},{"text":"Free eats, free beer. rsvp@sashayevents.com","to_user_id":null,"from_user":"jonjon411","id":2404584310,"from_user_id":18690710,"iso_language_code":"en","source":"&lt;a href=&quot;http:\/\/twitter.com\/&quot;&gt;web&lt;\/a&gt;","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/276301021\/green_2378_cut_hair_normal.jpg","created_at":"Tue, 30 Jun 2009 15:03:42 +0000"},{"text":"Today: pancakes, and LotR. Tomorrow: Canada's birthday, beer, and pie.","to_user_id":null,"from_user":"blackmesaeast","id":2404582296,"from_user_id":4210488,"iso_language_code":"en","source":"&lt;a href=&quot;http:\/\/twitter.com\/&quot;&gt;web&lt;\/a&gt;","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/203669231\/ph008_ravenrouge__normal.png","created_at":"Tue, 30 Jun 2009 15:03:33 +0000"},{"text":"Small beer firm helps troubled teens - http:\/\/bit.ly\/5wVzL","to_user_id":null,"from_user":"InternetJunkee","id":2404582076,"from_user_id":24711327,"iso_language_code":"en","source":"&lt;a href=&quot;http:\/\/twitter.com\/&quot;&gt;web&lt;\/a&gt;","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/134891444\/Me_1_normal.JPG","created_at":"Tue, 30 Jun 2009 15:03:32 +0000"},{"text":"ha dad going to ac dc . he owes me money too . he'll end up spending that on t-shirts or beer","to_user_id":null,"from_user":"Tulippee","id":2404581616,"from_user_id":17109021,"iso_language_code":"en","source":"&lt;a href=&quot;http:\/\/twitter.com\/&quot;&gt;web&lt;\/a&gt;","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/275211879\/DSC05211_normal.JPG","created_at":"Tue, 30 Jun 2009 15:03:30 +0000"},{"text":"Listening to Sonic this morning, best quote ever: &quot;What grows in the beer gardens? High risk, degrading sex with strangers.&quot;","to_user_id":null,"from_user":"redheadpixie","id":2404580561,"from_user_id":17271450,"iso_language_code":"en","source":"&lt;a href=&quot;http:\/\/twitterfox.net\/&quot;&gt;TwitterFox&lt;\/a&gt;","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/213705977\/JM_0184sm2_normal.JPG","created_at":"Tue, 30 Jun 2009 15:03:26 +0000"},{"text":"New PC terminology. Instead of &quot;Beer Belly,&quot; we're going to call it &quot;Malt Beverage Midriff.&quot; Who's with me?","to_user_id":null,"from_user":"pottymouthcon","id":2404579509,"from_user_id":15895914,"iso_language_code":"en","source":"&lt;a href=&quot;http:\/\/twitter.com\/&quot;&gt;web&lt;\/a&gt;","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/200753088\/toilet_normal.jpg","created_at":"Tue, 30 Jun 2009 15:03:21 +0000"},{"text":"bored, bored, bored, bored. I wanna go to Moe's and have a beer w\/ Homer. (and then go to neverland. L)","to_user_id":null,"from_user":"thewayofcontrol","id":2404579096,"from_user_id":10148206,"iso_language_code":"en","source":"&lt;a href=&quot;http:\/\/twitter.com\/&quot;&gt;web&lt;\/a&gt;","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/285813999\/100_1632_6_ava_normal.jpg","created_at":"Tue, 30 Jun 2009 15:03:20 +0000"}],"since_id":0,"max_id":2404598347,"refresh_url":"?since_id=2404598347&q=beer+-root","results_per_page":15,"next_page":"?page=2&max_id=2404598347&q=beer+-root","completed_in":0.167684,"page":1,"query":"beer+-root"}
20 changes: 20 additions & 0 deletions test/json/flight_negative_tude.json
@@ -0,0 +1,20 @@
HTTP/1.1 200 OK
Date: Tue, 30 Jun 2009 17:14:20 GMT
Server: hi
Status: 200 OK
X-Served-From: searchdb001
X-Timeline-Cache-Hit: Miss
Cache-Control: max-age=60, must-revalidate, max-age=300
Content-Type: application/json; charset=utf-8
X-Served-By: searchweb001.twitter.com
Expires: Tue, 30 Jun 2009 17:19:20 GMT
Content-Length: 7475
Vary: Accept-Encoding
X-Varnish: 1605495383
Age: 0
Via: 1.1 varnish
X-Cache-Svr: searchweb001.twitter.com
X-Cache: MISS
Connection: close

{"results":[{"text":"@alun i missed a flight (from heathrow) once because of them #eastmidlandstrains :(","to_user_id":235009,"to_user":"alun","from_user":"MXML","id":2406386625,"from_user_id":14608838,"iso_language_code":"en","source":"&lt;a href=&quot;http:\/\/twitter.com\/&quot;&gt;web&lt;\/a&gt;","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/212804556\/2009_04_26_Twitter_politique_normal.jpg","created_at":"Tue, 30 Jun 2009 17:11:52 +0000"},{"text":"Just landed in la time to go bored another flight woohooo :(","to_user_id":null,"from_user":"bigmike12790","id":2406373112,"from_user_id":23334906,"iso_language_code":"en","source":"&lt;a href=&quot;http:\/\/twitterfon.net\/&quot;&gt;TwitterFon&lt;\/a&gt;","profile_image_url":"http:\/\/static.twitter.com\/images\/default_profile_normal.png","created_at":"Tue, 30 Jun 2009 17:10:53 +0000"},{"text":"making a list for my flight tomorrow :( im gonna miss illinois","to_user_id":null,"from_user":"alliecrivello","id":2406209149,"from_user_id":13364643,"iso_language_code":"en","source":"&lt;a href=&quot;http:\/\/twitter.com\/&quot;&gt;web&lt;\/a&gt;","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/264926278\/get-attachment-2_normal.jpg","created_at":"Tue, 30 Jun 2009 16:59:27 +0000"},{"text":"@dijibeatnetwork I actualy have a bikini shoot scheduled in 3 weeks on the West coast.. but dont have my flight tix yet :( itchin 4 a shoot!","to_user_id":13455661,"to_user":"dijibeatnetwork","from_user":"promogurl","id":2406045858,"from_user_id":1534929,"iso_language_code":"en","source":"&lt;a href=&quot;http:\/\/twitter.com\/&quot;&gt;web&lt;\/a&gt;","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/241412287\/coming_for_you_normal.jpg","created_at":"Tue, 30 Jun 2009 16:47:52 +0000"},{"text":"OMG I can't wait for the 4th of July!!! It's gonna be so much fun, but I'll be fuck tired cause my flight is at 5am :(","to_user_id":null,"from_user":"ChristianDefaux","id":2406009369,"from_user_id":23264287,"iso_language_code":"en","source":"&lt;a href=&quot;http:\/\/twitterfon.net\/&quot;&gt;TwitterFon&lt;\/a&gt;","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/282590926\/green_0263_syaoran_normal.jpg","created_at":"Tue, 30 Jun 2009 16:45:22 +0000"},{"text":"3 hours left before the first flight... bye canada. :-(","to_user_id":null,"from_user":"pschoening","id":2405912848,"from_user_id":23314822,"iso_language_code":"en","source":"&lt;a href=&quot;http:\/\/twitter.com\/&quot;&gt;web&lt;\/a&gt;","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/273770016\/007_normal.jpg","created_at":"Tue, 30 Jun 2009 16:38:22 +0000"},{"text":"Nope - they're not! Some airports are better than others to be stuck in tho. RT @TheMandyMoore: Flight delays are not fun. :(","to_user_id":null,"from_user":"JENw1n525","id":2405861483,"from_user_id":15420853,"iso_language_code":"en","source":"&lt;a href=&quot;http:\/\/www.twittergadget.com&quot;&gt;TwitterGadget&lt;\/a&gt;","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/200572189\/me_dos_gringos_5-08_normal.JPG","created_at":"Tue, 30 Jun 2009 16:34:44 +0000"},{"text":"@Jezriyah Well, you can't refund your flight and hotel, and now it's too late to give the ticket to anyone else. So you're going :P","to_user_id":4805823,"to_user":"Jezriyah","from_user":"Ktok","id":2405552070,"from_user_id":814347,"iso_language_code":"en","source":"&lt;a href=&quot;http:\/\/twitter.com\/&quot;&gt;web&lt;\/a&gt;","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/269364525\/ktok_red_normal.jpg","created_at":"Tue, 30 Jun 2009 16:12:58 +0000"},{"text":"Nite! Gotta wake up early tomorrow to catch the flight for me to go back to Jakarta again. I miss my room but I will also miss Singapore :(","to_user_id":null,"from_user":"keshia0909","id":2405477931,"from_user_id":21430015,"iso_language_code":"en","source":"&lt;a href=&quot;http:\/\/orangatame.com\/products\/twitterberry\/&quot;&gt;TwitterBerry&lt;\/a&gt;","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/288720191\/jalex_normal.png","created_at":"Tue, 30 Jun 2009 16:07:35 +0000"},{"text":"@sunshineinajar I watched like all the movies on my flight over the Atlantic lol. I was sad they didn't have Twilight :(","to_user_id":7355094,"to_user":"sunshineinajar","from_user":"lovethatlook","id":2405280731,"from_user_id":13358833,"iso_language_code":"en","source":"&lt;a href=&quot;http:\/\/twitter.com\/&quot;&gt;web&lt;\/a&gt;","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/73828111\/n627456468_1275479_7454_normal.jpg","created_at":"Tue, 30 Jun 2009 15:53:43 +0000"},{"text":"Flight's at 5pm, medication is at 5:01pm :P","to_user_id":null,"from_user":"jokesongreg","id":2405263036,"from_user_id":8337070,"iso_language_code":"en","source":"&lt;a href=&quot;http:\/\/orangatame.com\/products\/twitterberry\/&quot;&gt;TwitterBerry&lt;\/a&gt;","profile_image_url":"http:\/\/static.twitter.com\/images\/default_profile_normal.png","created_at":"Tue, 30 Jun 2009 15:52:27 +0000"},{"text":"Fell asleep out of exhaustion and DH left for flight while I was asleep, said he didn't want to disturb me.. so sad. : (","to_user_id":null,"from_user":"CptCswife","id":2404907630,"from_user_id":6455771,"iso_language_code":"en","source":"&lt;a href=&quot;http:\/\/www.tweetdeck.com\/&quot;&gt;TweetDeck&lt;\/a&gt;","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/288168497\/angelina2_normal.gif","created_at":"Tue, 30 Jun 2009 15:27:01 +0000"},{"text":"Just found out from expedia that my flight back from Cologne has been changed. It's now 9am!!! Early start coming home then. Damn :(","to_user_id":null,"from_user":"Gari14WENB","id":2404887895,"from_user_id":15551217,"iso_language_code":"en","source":"&lt;a href=&quot;http:\/\/twitterfon.net\/&quot;&gt;TwitterFon&lt;\/a&gt;","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/196734794\/Pic128_normal.jpg","created_at":"Tue, 30 Jun 2009 15:25:34 +0000"},{"text":"I agree! Especially when u hv 2 catch a connecting flite! I lived that nitemare 2 wks ago! RT @TheMandyMoore: Flight delays are not fun. :(","to_user_id":null,"from_user":"TheWildOne","id":2404859125,"from_user_id":8811835,"iso_language_code":"en","source":"&lt;a href=&quot;http:\/\/help.twitter.com\/index.php?pg=kb.page&amp;id=75&quot;&gt;txt&lt;\/a&gt;","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/135373204\/Kay.20090314.by_Danielle_Williamson.edit.001.crop_normal.jpg","created_at":"Tue, 30 Jun 2009 15:23:29 +0000"},{"text":"Flight delays are not fun. :( (via @TheMandyMoore) 2nd that! Aloha &amp; safe travels!","to_user_id":null,"from_user":"Aceman808","id":2404848665,"from_user_id":2808797,"iso_language_code":"en","source":"&lt;a href=&quot;http:\/\/www.atebits.com\/&quot;&gt;Tweetie&lt;\/a&gt;","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/265678031\/Avatar_Green_normal.jpg","created_at":"Tue, 30 Jun 2009 15:22:43 +0000"}],"since_id":0,"max_id":2406386625,"refresh_url":"?since_id=2406386625&q=flight+%3A%28","results_per_page":15,"next_page":"?page=2&max_id=2406386625&q=flight+%3A%28","completed_in":0.039279,"page":1,"query":"flight+%3A%28"}

0 comments on commit 33a935f

Please sign in to comment.