Sha256: 4ce5f6a69be413980e551876a95b1bf6633f910c3a44f0f947ee24b0e159ab03

Contents?: true

Size: 1.07 KB

Versions: 22

Compression:

Stored size: 1.07 KB

Contents

require 'spec/spec_helper'

describe "Sphinx Keywords" do
  before :each do
    @client = Riddle::Client.new("localhost", 3313)
  end
  
  it "should return an array of hashes" do
    results = @client.keywords("pat", "people")
    results.should be_kind_of(Array)
    
    results.each do |result|
      result.should be_kind_of(Hash)
    end
  end
  
  it "should have keys for normalised and tokenised versions of the keywords" do
    results = @client.keywords("pat", "people")
    results.each do |result|
      result.keys.should include(:normalised)
      result.keys.should include(:tokenised)
    end
  end
  
  it "shouldn't have docs or hits keys if not requested" do
    results = @client.keywords("pat", "people")
    results.each do |result|
      result.keys.should_not include(:docs)
      result.keys.should_not include(:hits)
    end
  end
  
  it "should have docs and hits keys if requested" do
    results = @client.keywords("pat", "people", true)
    results.each do |result|
      result.keys.should include(:docs)
      result.keys.should include(:hits)
    end
  end
end

Version data entries

22 entries across 22 versions & 3 rubygems

Version Path
freelancing-god-riddle-0.9.8.1371.1 spec/functional/keywords_spec.rb
freelancing-god-riddle-0.9.8.1371.2 spec/functional/keywords_spec.rb
freelancing-god-riddle-0.9.8.1533.1 spec/functional/keywords_spec.rb
freelancing-god-riddle-0.9.8.1533.2 spec/functional/keywords_spec.rb
freelancing-god-riddle-0.9.8.1533.3 spec/functional/keywords_spec.rb
freelancing-god-riddle-0.9.8.1533.4 spec/functional/keywords_spec.rb
freelancing-god-riddle-0.9.8.1533.5 spec/functional/keywords_spec.rb
freelancing-god-riddle-0.9.8.1533.7 spec/functional/keywords_spec.rb
freelancing-god-riddle-0.9.8.1533.8 spec/functional/keywords_spec.rb
freelancing-god-riddle-0.9.8.1533.9 spec/functional/keywords_spec.rb
riddle-1.0.6 spec/functional/keywords_spec.rb
riddle-1.0.5 spec/functional/keywords_spec.rb
riddle-1.0.4 spec/functional/keywords_spec.rb
riddle-1.0.3 spec/functional/keywords_spec.rb
riddle-1.0.2 spec/functional/keywords_spec.rb
riddle-1.0.1 spec/functional/keywords_spec.rb
riddle-1.0.0 spec/functional/keywords_spec.rb
riddle-0.9.8.1533.10 spec/functional/keywords_spec.rb
riddle-0.9.8.1231.0 spec/functional/keywords_spec.rb
riddle-0.9.8.1198 spec/functional/keywords_spec.rb