test/songkickr/test_remote.rb in songkickr-0.4.1 vs test/songkickr/test_remote.rb in songkickr-0.5.0
- old
+ new
@@ -129,32 +129,63 @@
result = @remote.artist_events(109675)
assert_equal "Senses Fail at The Zoo (August 7, 2013)", result.results.first.display_name
end
end
- should "return the artist when searched" do
- VCR.use_cassette('artist_search') do
+ should "return the artist when searched as a string" do
+ VCR.use_cassette('artist_search_string') do
result = @remote.artist_search('Counterparts')
assert_equal "Counterparts", result.results.first.display_name
end
end
+ should "return the artist with paged results when searched as a hash" do
+ VCR.use_cassette('paged_artist_search') do
+ result = @remote.artist_search(:artist_name => 'Counterparts', :per_page => 2)
+ assert_equal 2, result.results.size
+ end
+ end
+
+ should "return the artist when searched as a hash" do
+ VCR.use_cassette('artist_search_hash') do
+ result = @remote.artist_search(:artist_name => 'Counterparts')
+ assert_equal "Counterparts", result.results.first.display_name
+ end
+ end
+
should "return the event when searched" do
VCR.use_cassette('event_search') do
result = @remote.events(:artist_name => 'Counterparts')
assert_equal "Sound and Fury 2013", result.results.first.display_name
end
end
should "return the location when searched" do
VCR.use_cassette('location_search') do
- result = @remote.location_search('St. Paul, MN')
+ result = @remote.location_search(:query => 'St. Paul, MN')
assert_equal "St. Paul", result.results.first.city
assert_equal Songkickr::MetroArea, result.results.first.metro_area.class
end
end
+ should "return the locations when searched with pagination" do
+ VCR.use_cassette('location_search_paged') do
+ result = @remote.location_search(:query => 'St. Paul, MN', :per_page => 2)
+ assert_equal "St. Paul", result.results.first.city
+ assert_equal Songkickr::MetroArea, result.results.first.metro_area.class
+ assert_equal 2, result.results.size
+ end
+ end
+
+ should "return the locations when searching by geographic location" do
+ VCR.use_cassette('location_search_geo') do
+ result = @remote.location_search_geo(51.5078, -0.128)
+ assert_equal "London", result.results.first.city
+ assert_equal Songkickr::MetroArea, result.results.first.metro_area.class
+ end
+ end
+
should "return the metro area events when searched" do
VCR.use_cassette('metro_areas_events') do
result = @remote.metro_areas_events(35130)
assert_equal "Duluth Waterfront/Bayfront Festival Park 2013", result.results.first.display_name
end
@@ -167,11 +198,19 @@
end
end
should "return the search venue" do
VCR.use_cassette('venue_search') do
- result = @remote.venue_search('Xcel Energy Center')
+ result = @remote.venue_search(:query => 'Xcel Energy Center')
assert_equal "Xcel Energy Center", result.results.first.display_name
+ end
+ end
+
+ should "return the searched venue with paged results" do
+ VCR.use_cassette('venue_search_paged') do
+ result = @remote.venue_search(:query => 'Xcel Energy Center', :per_page => 2)
+ assert_equal "Xcel Energy Center", result.results.first.display_name
+ assert_equal 2, result.results.size
end
end
should "return the users tracked metro areas" do
VCR.use_cassette('users_tracked_metro_areas') do