Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

file 28 lines (26 sloc) 1.015 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
assert = require 'assert'
vows = require 'vows'
echonest = require '../../lib/echonest'
util = require '../util'

checkErrors = util.checkErrors

vows.describe('multibucket support').addBatch({
  'when using echonest':
    topic: new echonest.Echonest
    "to search for soul to squeeze with multiple buckets:
audio_summary, track, id:rdio":
      topic: (nest) ->
        nest.song.search {
          title: 'soul to squeeze'
          bucket: ['tracks', 'audio_summary', 'id:rdio-us-streaming']
          limit: true
        }, @callback
        undefined
      'we get foreign ids and an audio_summary!': (err, data) ->
        rhcp_songs = (song.artist_name for song in data.songs)
        assert.include rhcp_songs, 'Red Hot Chili Peppers'
        first_song = data.songs[0]
        # look at foreign ids and danceability
        assert.isTrue first_song.foreign_ids.length > 0
        assert.isNotNull first_song.audio_summary.danceability
      'we see no errors': checkErrors
}).export module
Something went wrong with that request. Please try again.