Sha256: d6048fde34db6c55cdaa771dca6a2c4e412de1d432aead8b66766642157adf3d
Contents?: true
Size: 781 Bytes
Versions: 11
Compression:
Stored size: 781 Bytes
Contents
require File.expand_path("../test_helper", __FILE__) class NotTest < SearchCop::TestCase def test_not_string expected = create(:product, :title => "Expected title") rejected = create(:product, :title => "Rejected title") results = Product.search("title: Title NOT title: Rejected") assert_includes results, expected refute_includes results, rejected assert_equal results, Product.search("title: Title -title: Rejected") end def test_not_hash expected = create(:product, :title => "Expected title") rejected = create(:product, :title => "Rejected title") results = Product.search(:and => [{:title => "Title"}, {:not => {:title => "Rejected"}}]) assert_includes results, expected refute_includes results, rejected end end
Version data entries
11 entries across 11 versions & 1 rubygems