1
0
Fork 0
mirror of https://github.com/activerecord-hackery/ransack.git synced 2022-11-09 13:47:45 -05:00
activerecord-hackery--ransack/spec/ransack/nodes/condition_spec.rb

20 lines
523 B
Ruby
Raw Normal View History

require '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 { subject.values.should have(2).values }
end
context 'with an invalid predicate' do
subject { Condition.extract(Context.for(Person), 'name_invalid', Person.first.name) }
specify { subject.should be_nil }
end
end
end
end