Sha256: 8844a90dc9522cd0349b3635f3e275e31b3d7f64d0328d49227943000cc5a665
Contents?: true
Size: 837 Bytes
Versions: 11
Compression:
Stored size: 837 Bytes
Contents
require File.expand_path("../test_helper", __FILE__) class OrTest < SearchCop::TestCase def test_or_string product1 = create(:product, :title => "Title1") product2 = create(:product, :title => "Title2") product3 = create(:product, :title => "Title3") results = Product.search("title: Title1 OR title: Title2") assert_includes results, product1 assert_includes results, product2 refute_includes results, product3 end def test_or_hash product1 = create(:product, :title => "Title1") product2 = create(:product, :title => "Title2") product3 = create(:product, :title => "Title3") results = Product.search(:or => [{:title => "Title1"}, {:title => "Title2"}]) assert_includes results, product1 assert_includes results, product2 refute_includes results, product3 end end
Version data entries
11 entries across 11 versions & 1 rubygems