Sha256: 394896f990ba1e4b1949077c0d6ff385cfbc592960dcb5e38d385f73e0207382

Contents?: true

Size: 682 Bytes

Versions: 3

Compression:

Stored size: 682 Bytes

Contents

$:.unshift File.dirname(__FILE__)

require 'spec_helper'

include SpecHelper

describe Echonest::Response do
  before do
    @success = Echonest::Response.new(open(fixture('profile.json')).read)
    @failure = Echonest::Response.new(open(fixture('profile_failure.json')).read)
  end

  it "should return status" do
    @success.status.code.should eql(0)
    @success.status.message.should eql('Success')
    @success.should be_success
    @success.body.track.artist.should eql('Philip Glass')

    @failure.status.code.should eql(1)
    @failure.status.message.should eql('api_key - Invalid key: "XXXXX" is not a valid, active api key')
    @failure.should_not be_success
  end
end

Version data entries

3 entries across 3 versions & 2 rubygems

Version Path
bassnode-ruby-echonest-0.1.3 spec/response_spec.rb
bassnode-ruby-echonest-0.1.2 spec/response_spec.rb
ruby-echonest-0.1.1 spec/response_spec.rb