Sha256: 4182d959fd7e212a94671db56391814f06e863b7d394774d560c94f90560aeea
Contents?: true
Size: 987 Bytes
Versions: 11
Compression:
Stored size: 987 Bytes
Contents
require 'mongoid_spec_helper' module Ransack module Nodes describe Condition do context 'with multiple values and an _any predicate' do subject { Condition.extract(Context.for(Person), 'name_eq_any', Person.first(2).map(&:name)) } specify { expect(subject.values.size).to eq(2) } end context 'with an invalid predicate' do subject { Condition.extract(Context.for(Person), 'name_invalid', Person.first.name) } context "when ignore_unknown_conditions is false" do before do Ransack.configure { |config| config.ignore_unknown_conditions = false } end specify { expect { subject }.to raise_error ArgumentError } end context "when ignore_unknown_conditions is true" do before do Ransack.configure { |config| config.ignore_unknown_conditions = true } end specify { subject.should be_nil } end end end end end
Version data entries
11 entries across 11 versions & 3 rubygems