Sha256: ebaa31804eef8e28245f4ece19e60665fd3f612ed6f5b1d28a50ebd1739f703b

Contents?: true

Size: 734 Bytes

Versions: 10

Compression:

Stored size: 734 Bytes

Contents

require File.dirname(__FILE__) + '/../test_helper.rb'

module ConditionsTests
  class MultiparameterAttributesTest < ActiveSupport::TestCase
    def test_conditions
      values = {"created_at(1i)" => "2004", "created_at(2i)" => "6", "created_at(3i)" => "24"}
      conditions = Searchlogic::Cache::AccountConditions.new(values)
      assert_equal ["\"accounts\".\"created_at\" = ?", Time.parse("Jun 24, 2004")], conditions.sanitize
      
      values = {"created_at_gt(1i)" => "2004", "created_at_gt(2i)" => "6", "created_at_gt(3i)" => "24"}
      conditions = Searchlogic::Cache::AccountConditions.new(values)
      assert_equal ["\"accounts\".\"created_at\" > ?", Time.parse("Jun 24, 2004")], conditions.sanitize
    end
  end
end

Version data entries

10 entries across 10 versions & 2 rubygems

Version Path
schof-searchlogic-0.0.2 test/conditions_tests/multiparameter_attributes_test.rb
searchlogic-1.6.1 test/conditions_tests/multiparameter_attributes_test.rb
searchlogic-1.5.10 test/conditions_tests/multiparameter_attributes_test.rb
searchlogic-1.5.8 test/conditions_tests/multiparameter_attributes_test.rb
searchlogic-1.6.0 test/conditions_tests/multiparameter_attributes_test.rb
searchlogic-1.5.9 test/conditions_tests/multiparameter_attributes_test.rb
searchlogic-1.6.2 test/conditions_tests/multiparameter_attributes_test.rb
searchlogic-1.6.5 test/conditions_tests/multiparameter_attributes_test.rb
searchlogic-1.6.3 test/conditions_tests/multiparameter_attributes_test.rb
searchlogic-1.6.4 test/conditions_tests/multiparameter_attributes_test.rb