Sha256: fd9853551a71c0bd286307e6c4677e80fa07160f24ed69d9494679a9bc2682bb

Contents?: true

Size: 503 Bytes

Versions: 16

Compression:

Stored size: 503 Bytes

Contents

require 'spec_helper'

describe Datagrid::Filters::BaseFilter do
  

  it "should support default option as block" do
    report = test_report do
      scope {Entry}
      filter(:name, :string, :default => :name_default)
      def name_default
        'hello'
      end
    end
    expect(report.assets).to include(Entry.create!(:name => "hello"))
    expect(report.assets).not_to include(Entry.create!(:name => "world"))
    expect(report.assets).not_to include(Entry.create!(:name => ""))
  end

end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
datagrid-1.6.1 spec/datagrid/filters/base_filter_spec.rb
datagrid-1.6.0 spec/datagrid/filters/base_filter_spec.rb
datagrid-1.5.9 spec/datagrid/filters/base_filter_spec.rb
datagrid-1.5.8 spec/datagrid/filters/base_filter_spec.rb
datagrid-1.5.7 spec/datagrid/filters/base_filter_spec.rb
datagrid-1.5.6 spec/datagrid/filters/base_filter_spec.rb
datagrid-1.5.5 spec/datagrid/filters/base_filter_spec.rb
datagrid-1.5.4 spec/datagrid/filters/base_filter_spec.rb
datagrid-1.5.3 spec/datagrid/filters/base_filter_spec.rb
datagrid-1.5.2 spec/datagrid/filters/base_filter_spec.rb
datagrid-1.5.1 spec/datagrid/filters/base_filter_spec.rb
datagrid-1.5.0 spec/datagrid/filters/base_filter_spec.rb
datagrid-1.4.4 spec/datagrid/filters/base_filter_spec.rb
datagrid-1.4.3 spec/datagrid/filters/base_filter_spec.rb
datagrid-1.4.2 spec/datagrid/filters/base_filter_spec.rb
datagrid-1.4.1 spec/datagrid/filters/base_filter_spec.rb