Sha256: 1a6efa546924fd23f04ff9cc8a3c2b2dc76af65812863c5faf7b278c9101ac9e

Contents?: true

Size: 1.51 KB

Versions: 27

Compression:

Stored size: 1.51 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
  
  it "should render a filter that is an array of boolean values correctly" do
    filter = Riddle::Client::Filter.new("field", [false, true])
    filter.query_message.should == query_contents(:filter_boolean)
  end
end

Version data entries

27 entries across 27 versions & 2 rubygems

Version Path
freelancing-god-riddle-0.9.8.1371.2 spec/unit/filter_spec.rb
freelancing-god-riddle-0.9.8.1533.1 spec/unit/filter_spec.rb
freelancing-god-riddle-0.9.8.1533.2 spec/unit/filter_spec.rb
freelancing-god-riddle-0.9.8.1533.3 spec/unit/filter_spec.rb
freelancing-god-riddle-0.9.8.1533.4 spec/unit/filter_spec.rb
freelancing-god-riddle-0.9.8.1533.5 spec/unit/filter_spec.rb
freelancing-god-riddle-0.9.8.1533.7 spec/unit/filter_spec.rb
freelancing-god-riddle-0.9.8.1533.8 spec/unit/filter_spec.rb
freelancing-god-riddle-0.9.8.1533.9 spec/unit/filter_spec.rb
riddle-1.2.2 spec/unit/filter_spec.rb
riddle-1.2.1 spec/unit/filter_spec.rb
riddle-1.2.0 spec/unit/filter_spec.rb
riddle-1.1.0 spec/unit/filter_spec.rb
riddle-1.0.12 spec/unit/filter_spec.rb
riddle-1.0.11 spec/unit/filter_spec.rb
riddle-1.0.10 spec/unit/filter_spec.rb
riddle-1.0.9 spec/unit/filter_spec.rb
riddle-1.0.8 spec/unit/filter_spec.rb
riddle-1.0.7 spec/unit/filter_spec.rb
riddle-1.0.6 spec/unit/filter_spec.rb