Sha256: 60fcfecd4917153409fb044f9817d971a40d6caa68aab0b050f16c6bf60393ce

Contents?: true

Size: 672 Bytes

Versions: 14

Compression:

Stored size: 672 Bytes

Contents

require File.dirname(__FILE__) + '/../liquid_helper'
include LiquidHelperMethods

module RedmineCrm
  class ArraysFilterTest < ActiveSupport::TestCase
    def setup
      @liquid_render = LiquidRender.new
      @array = '6,7,8,9,1,2,3,4,5'
    end

    def test_first_filter
      assert_match '1', @liquid_render.render("{{ '#{@array}' | split: ',' | first: 5 | last }}")
    end

    def test_sort_filter
      assert_match '123456789', @liquid_render.render("{{ '#{@array}' | split: ',' | sort }}")
    end

    def test_where_filter
      assert_match '{"name"=>"two", "value"=>5}', @liquid_render.render("{{ objects_arr | where: 'name', 'two' }}")
    end

  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
redmine_crm-0.0.40 test/liquid/filters/arrays_filter_test.rb
redmine_crm-0.0.38 test/liquid/filters/arrays_filter_test.rb
redmine_crm-0.0.37 test/liquid/filters/arrays_filter_test.rb
redmine_crm-0.0.36 test/liquid/filters/arrays_filter_test.rb
redmine_crm-0.0.35 test/liquid/filters/arrays_filter_test.rb
redmine_crm-0.0.34 test/liquid/filters/arrays_filter_test.rb
redmine_crm-0.0.33 test/liquid/filters/arrays_filter_test.rb
redmine_crm-0.0.32 test/liquid/filters/arrays_filter_test.rb
redmine_crm-0.0.31 test/liquid/filters/arrays_filter_test.rb
redmine_crm-0.0.30 test/liquid/filters/arrays_filter_test.rb
redmine_crm-0.0.28 test/liquid/filters/arrays_filter_test.rb
redmine_crm-0.0.27 test/liquid/filters/arrays_filter_test.rb
redmine_crm-0.0.26 test/liquid/filters/arrays_filter_test.rb
redmine_crm-0.0.25 test/liquid/filters/arrays_filter_test.rb