Sha256: 6c0473df1bdf36e2738fb6ed3c16d6876354c587779068c735b645d32be61904

Contents?: true

Size: 1.19 KB

Versions: 1

Compression:

Stored size: 1.19 KB

Contents

require 'spec_helper'

module Beatport::Catalog
  describe Autocomplete do
    describe 'stucture' do
      subject do
        VCR.use_cassette("autocomplete_lutzen") { Autocomplete.query('lutzen').first }
      end
      
      its (:'name.downcase') { should match(/lutzen/) }
    end
    
    describe 'collection' do
      subject do
        VCR.use_cassette("autocomplete_lutzen") { Autocomplete.query('lutzen') }
      end
      
      its (:host) { should == "api.beatport.com" }
      its (:path) { should == "/catalog/autocomplete" }
      its (:query) { should == "query=lutzen" }
      its (:page) { should == 1 }
      its (:per_page) { should == 10 }
      its (:count) { should be > 1 }
      its (:total_pages) { should be > 1 }
      its (:next_query) { should == "query=lutzen&page=2"}
      its (:per_page_options) { should_not be_nil }
      its (:facets) { should_not be_nil }
      its (:spellcheck) { should_not be_nil }
    end
    
    describe '.query' do
      subject do
        VCR.use_cassette("autocomplete_lutzen_page_3") { Autocomplete.query('lutzen', :page => 3, :per_page => 2) }
      end
      
      its (:page) { should == 3 }
      its (:per_page) { should == 2 }
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
beatport-0.1.5 spec/catalog/autocomplete_spec.rb