Sha256: 13f2052f831498f78bb224d4a91ca550b6d7c225dbb8f3e567ceef1e0455f957

Contents?: true

Size: 1.23 KB

Versions: 28

Compression:

Stored size: 1.23 KB

Contents

require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')

describe '#geo' do
  before { init_lastfm }

  it 'should return an instance of Lastfm::Geo' do
    @lastfm.geo.should be_an_instance_of(Lastfm::MethodCategory::Geo)
  end

  describe '#get_events' do
    it 'should get events' do
      @lastfm.should_receive(:request).with('geo.getEvents', {
        :location => 'Boulder',
        :distance => nil,
        :limit => nil,
        :page => nil
      }).and_return(make_response('geo_get_events'))

      events = @lastfm.geo.get_events(:location => 'Boulder')
      events.size.should == 1
      events[0]['title'].should == 'Transistor Festival'
      events[0]['artists'].size.should == 2
      events[0]['artists']['headliner'].should == 'Not Breathing'
      events[0]['venue']['name'].should == 'The Walnut Room'
      events[0]['venue']['location']['city'].should == 'Denver, CO'
      events[0]['venue']['location']['point']['lat'].should == '39.764316'
      events[0]['image'].size.should == 4
      events[0]['image'][0]['size'].should == 'small'
      events[0]['image'][0]['content'].should == 'http://userserve-ak.last.fm/serve/34/166214.jpg'
      events[0]['startDate'].should == 'Fri, 10 Jun 2011 01:58:01'
    end
  end
end

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
lastfm-1.27.3 spec/method_specs/geo_spec.rb
lastfm-1.27.2 spec/method_specs/geo_spec.rb
lastfm-1.27.1 spec/method_specs/geo_spec.rb
lastfm-1.27.0 spec/method_specs/geo_spec.rb
lastfm-1.26.0 spec/method_specs/geo_spec.rb
lastfm-1.25.0 spec/method_specs/geo_spec.rb
lastfm-1.24.0 spec/method_specs/geo_spec.rb
lastfm-1.23.0 spec/method_specs/geo_spec.rb
lastfm-1.22.0 spec/method_specs/geo_spec.rb
lastfm-1.21.0 spec/method_specs/geo_spec.rb
lastfm-1.20.1 spec/method_specs/geo_spec.rb
lastfm-1.19.1 spec/method_specs/geo_spec.rb
lastfm-1.19.0 spec/method_specs/geo_spec.rb
lastfm-1.18.0 spec/method_specs/geo_spec.rb
lastfm-1.17.0 spec/method_specs/geo_spec.rb
lastfm-1.16.0 spec/method_specs/geo_spec.rb
lastfm-1.15.1 spec/method_specs/geo_spec.rb
lastfm-1.15.0 spec/method_specs/geo_spec.rb
lastfm-1.14.1 spec/method_specs/geo_spec.rb
lastfm-1.14.0 spec/method_specs/geo_spec.rb