Sha256: cd8a6e63becb14d81b85751603d8f50b3a9425d22fdf06201c87b00444a891a0

Contents?: true

Size: 771 Bytes

Versions: 3

Compression:

Stored size: 771 Bytes

Contents

require 'spec_helper'

describe Conquiro::SearchAPI::Adapter, vcr: {match_requests_on: [:method, :uri]} do
  let(:adapter) { described_class.new }
  let(:criteria) { Conquiro::Criteria.new('yelp', 'us', 'software') }
  let(:results) { adapter.query(criteria) }
  let(:first_result) { results.first }
  let(:result_types) { results.map(&:class).uniq }
  describe 'when searching for yelp app' do
    it 'should find 50 search results' do
      expect(results.size).to eq(50)
    end

    it 'should return a Conquiro::Software entity' do
      expect(result_types).to eq([Conquiro::Software])
    end

    it 'should return valid entities' do
      expect(first_result.seller_name).to eq('Yelp, Inc.')
      expect(first_result.track_name).to eq('Yelp')
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
conquiro-0.0.3 spec/lib/conquiro/search_api/adapter_spec.rb
conquiro-0.0.2 spec/lib/conquiro/search_api/adapter_spec.rb
conquiro-0.0.1 spec/lib/conquiro/search_api/adapter_spec.rb