Sha256: f1176c5c13bcb6aceb6b8fdbe04d3c25a4c2ad41a9d48cfc5f3cca54a011b0f0

Contents?: true

Size: 485 Bytes

Versions: 7

Compression:

Stored size: 485 Bytes

Contents

require 'spec_helper'

describe Datagrid::Filters::EnumFilter do

  it "should support select option" do
    test_report do
      scope {Entry}
      filter(:group_id, :enum, :select =>  [1,2] )
    end.class.filter_by_name(:group_id).select.should == [1,2]
  end

  it "should support select option as proc" do
    test_report do
      scope {Entry}
      filter(:group_id, :enum, :select => proc { [1,2] })
    end.class.filter_by_name(:group_id).select.should == [1,2]
  end
  
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
datagrid-0.5.3 spec/datagrid/filters/enum_filter_spec.rb
datagrid-0.5.2 spec/datagrid/filters/enum_filter_spec.rb
datagrid-0.5.1 spec/datagrid/filters/enum_filter_spec.rb
datagrid-0.5.0 spec/datagrid/filters/enum_filter_spec.rb
datagrid-0.4.0 spec/datagrid/filters/enum_filter_spec.rb
datagrid-0.3.6 spec/datagrid/filters/enum_filter_spec.rb
datagrid-0.3.5 spec/datagrid/filters/enum_filter_spec.rb