Permalink
Browse files

rpec for location_search with the foursquare_v2_id param

  • Loading branch information...
1 parent 0488d1e commit 7682f3ab0a786871aa27245930680c766e71186f locationstar committed Dec 9, 2012
Showing with 28 additions and 2 deletions.
  1. +1 −0 spec/fixtures/location_search_fsq.json
  2. +27 −2 spec/instagram/client/locations_spec.rb
@@ -0,0 +1 @@
+{"meta": {"code": 200}, "data": [{"latitude": 40.719607, "longitude": -73.986764, "id": "1075772", "name": "Schiller's Liquor Bar"}]}
@@ -50,7 +50,7 @@
end
end
- describe ".location_search" do
+ describe ".location_search_lat_lng" do
before do
stub_get("locations/search.#{format}").
@@ -59,7 +59,7 @@
to_return(:body => fixture("location_search.#{format}"), :headers => {:content_type => "application/#{format}; charset=utf-8"})
end
- it "should get the correct resource" do
+ it "should get the correct resource by lat/lng" do
@client.location_search("37.7808851", "-122.3948632")
a_get("locations/search.#{format}").
with(:query => {:access_token => @client.access_token}).
@@ -73,6 +73,31 @@
locations.first.name.should == "Instagram"
end
end
+
+ describe ".location_search_foursquare_v2_id" do
+
+ before do
+ stub_get("locations/search.#{format}").
+ with(:query => {:access_token => @client.access_token}).
+ with(:query => {:foursquare_v2_id => "3fd66200f964a520c5f11ee3"}).
+ to_return(:body => fixture("location_search_fsq.#{format}"), :headers => {:content_type => "application/#{format}; charset=utf-8"})
+ end
+
+ it "should get the correct resource by foursquare_v2_id" do
+ @client.location_search("3fd66200f964a520c5f11ee3")
+ a_get("locations/search.#{format}").
+ with(:query => {:access_token => @client.access_token}).
+ with(:query => {:foursquare_v2_id => "3fd66200f964a520c5f11ee3"}).
+ should have_been_made
+ end
+
+ it "should return an array of user search results" do
+ locations = @client.location_search("3fd66200f964a520c5f11ee3")
+ locations.should be_a Array
+ locations.first.name.should == "Schiller's Liquor Bar"
+ end
+ end
+
end
end
end

0 comments on commit 7682f3a

Please sign in to comment.