Sha256: 5f55d82576a61017a0fb63bbdf64417288c0c93c24de5289faef7f3db51cc2a7

Contents?: true

Size: 1.3 KB

Versions: 10

Compression:

Stored size: 1.3 KB

Contents

require 'spec/spec_helper'

describe Riddle::Client::Filter do
  it "should render a filter that uses an array of ints correctly" do
    filter = Riddle::Client::Filter.new("field", [1, 2, 3])
    filter.query_message.should == query_contents(:filter_array)
  end
  
  it "should render a filter that has exclude set correctly" do
    filter = Riddle::Client::Filter.new("field", [1, 2, 3], true)
    filter.query_message.should == query_contents(:filter_array_exclude)
  end
  
  it "should render a filter that is a range of ints correctly" do
    filter = Riddle::Client::Filter.new("field", 1..3)
    filter.query_message.should == query_contents(:filter_range)
  end
  
  it "should render a filter that is a range of ints as exclude correctly" do
    filter = Riddle::Client::Filter.new("field", 1..3, true)
    filter.query_message.should == query_contents(:filter_range_exclude)
  end
  
  it "should render a filter that is a range of floats correctly" do
    filter = Riddle::Client::Filter.new("field", 5.4..13.5)
    filter.query_message.should == query_contents(:filter_floats)
  end
  
  it "should render a filter that is a range of floats as exclude correctly" do
    filter = Riddle::Client::Filter.new("field", 5.4..13.5, true)
    filter.query_message.should == query_contents(:filter_floats_exclude)
  end
end

Version data entries

10 entries across 10 versions & 3 rubygems

Version Path
freelancing-god-riddle-0.9.8.1371.1 spec/unit/filter_spec.rb
riddle-0.9.8.1112 spec/unit/filter_spec.rb
riddle-0.9.8.1198 spec/unit/filter_spec.rb
riddle-0.9.8.1231.0 spec/unit/filter_spec.rb
riddle-0.9.8.1198.1 spec/unit/filter_spec.rb
ultrasphinx-1.6.7 vendor/riddle/spec/unit/filter_spec.rb
ultrasphinx-1.11 vendor/riddle/spec/unit/filter_spec.rb
ultrasphinx-1.9 vendor/riddle/spec/unit/filter_spec.rb
ultrasphinx-1.7 vendor/riddle/spec/unit/filter_spec.rb
ultrasphinx-1.8 vendor/riddle/spec/unit/filter_spec.rb