Sha256: d81cdcbb77fd97ae724ede2a4d97a6ba2508b3889d180593624f40fdee6295c5
Contents?: true
Size: 1.41 KB
Versions: 3
Compression:
Stored size: 1.41 KB
Contents
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper') describe Cafepress::Search::SearchResultSet do before(:all) do @result_xml = File.read(File.join(File.dirname(__FILE__), '..', 'data', 'dog_search.xml')) end before(:each) do @results = Cafepress::Search::SearchResultSet.parse(@result_xml) end it "should load the results" do @results.results.each { |result| result.is_a?(Cafepress::Search::SearchResult).should be_true } end it "the number of results loaded should match the given result set size" do @results.results.size.should == @results.size end it "should load the result set size" do @results.size.should == 60 end it "should know the total number of designs for this query" do @results.total_designs.should == 553352 end it "should know the total number of products for this query" do @results.total_products.should == 17744462 end it "should load the starting result index" do @results.start_index.should == 0 end it "should load the sort type" do @results.sort.should == 'by_score_desc' end it "should load the topics" do @results.topics.should == [ 'pets', 'pet', 'canine', 'puppy', 'gifts', 'animals', 'art', 'breeds', 'breed', 'humor' ] end it "should know the query used to generate the result set" do @results.query.should == "dog" end end
Version data entries
3 entries across 3 versions & 1 rubygems