Sha256: 9a705810202ca3f51df16a3b37f0725a3c8d2470d675c6e59ab04f0135e0202b

Contents?: true

Size: 444 Bytes

Versions: 2

Compression:

Stored size: 444 Bytes

Contents

require 'test_helper'

class StringModifierTest < ActiveSupport::TestCase
  include SetBuilder::Modifiers
  
  attr_reader :table
  
  setup do
    @table = Arel::Table.new(:fruits)
  end
  
  
  test "#build_arel_for should generate the correct SQL" do
    modifier = StringModifier.new({:does_not_contain => ["banana"]})
    assert_equal "\"fruits\".\"name\" NOT LIKE '%banana%'", modifier.build_arel_for(table[:name]).to_sql
  end
  
  
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
set_builder-1.2.0.beta3 test/string_modifier_test.rb
set_builder-1.2.0.beta2 test/string_modifier_test.rb