Sha256: 0540d13e17fd731f40eaf87bdce59c8262d8195af7f64933f920d3cdc9434b44

Contents?: true

Size: 1.05 KB

Versions: 1

Compression:

Stored size: 1.05 KB

Contents

# coding: utf-8
describe Hallon::ArtistBrowse do
  subject do
    mock_session do
      artist = Hallon::Artist.new(mock_artist)
      Spotify.should_receive(:artistbrowse_create).and_return(mock_artistbrowse)
      Hallon::ArtistBrowse.new(artist)
    end
  end

  it { should be_loaded }
  its(:error)  { should eq :ok }
  its(:artist) { should eq Hallon::Artist.new(mock_artist) }

  its('portraits.size') { should eq 2 }
  its('portraits.to_a') do
    Hallon::Session.should_receive(:instance).exactly(2).times.and_return(session)

    subject.map{ |img| img.id(true) }.should eq [mock_image_id, mock_image_id]
  end

  its('tracks.size') { should eq 2 }
  its('tracks.to_a') { should eq [mock_track, mock_track_two].map{ |p| Hallon::Track.new(p) } }
  its('albums.size') { should eq 1 }
  its('albums.to_a') { should eq [Hallon::Album.new(mock_album)] }
  its('similar_artists.size') { should eq 2 }
  its('similar_artists.to_a') { should eq [mock_artist, mock_artist_two].map{ |p| Hallon::Artist.new(p) } }
  its(:biography) { should eq 'grew up in DA BLOCK' }
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
hallon-0.8.0 spec/hallon/artist_browse_spec.rb