Sha256: 9856b61712fd26b0c6a82b5197b46e40498cded722834f1518beae9d6fa6a05a

Contents?: true

Size: 1.02 KB

Versions: 27

Compression:

Stored size: 1.02 KB

Contents

require 'test_helper'

module Workarea
  module Admin
    class FacetsHelperTest < ViewTest
      def test_facet_value_display_name
        facet = Workarea::Search::Facet.new(nil, 'tags')
        assert_equal('bar_baz', facet_value_display_name(facet, 'bar_baz'))

        facet = Workarea::Search::Facet.new(nil, 'colors')
        assert_equal('Bar Baz', facet_value_display_name(facet, 'bar_baz'))

        facet = Workarea::Search::Facet.new(nil, 'upcoming_changes')
        release = create_release(name: 'Foo Release')
        assert_equal('Foo Release', facet_value_display_name(facet, release.id))
        assert_nil(facet_value_display_name(facet, 'bar_baz'))

        facet = Workarea::Search::Facet.new(nil, 'active_by_segment')
        segment = create_segment(name: 'Foo Segment')
        assert_equal('Foo Segment', facet_value_display_name(facet, segment.id))
        assert_equal(
          t('workarea.admin.segments.missing', id: 'bar'),
          facet_value_display_name(facet, 'bar')
        )
      end
    end
  end
end

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
workarea-admin-3.5.27 test/helpers/workarea/admin/facets_helper_test.rb
workarea-admin-3.5.26 test/helpers/workarea/admin/facets_helper_test.rb
workarea-admin-3.5.25 test/helpers/workarea/admin/facets_helper_test.rb
workarea-admin-3.5.23 test/helpers/workarea/admin/facets_helper_test.rb
workarea-admin-3.5.22 test/helpers/workarea/admin/facets_helper_test.rb
workarea-admin-3.5.21 test/helpers/workarea/admin/facets_helper_test.rb
workarea-admin-3.5.20 test/helpers/workarea/admin/facets_helper_test.rb
workarea-admin-3.5.19 test/helpers/workarea/admin/facets_helper_test.rb
workarea-admin-3.5.18 test/helpers/workarea/admin/facets_helper_test.rb
workarea-admin-3.5.17 test/helpers/workarea/admin/facets_helper_test.rb
workarea-admin-3.5.16 test/helpers/workarea/admin/facets_helper_test.rb
workarea-admin-3.5.15 test/helpers/workarea/admin/facets_helper_test.rb
workarea-admin-3.5.14 test/helpers/workarea/admin/facets_helper_test.rb
workarea-admin-3.5.13 test/helpers/workarea/admin/facets_helper_test.rb
workarea-admin-3.5.12 test/helpers/workarea/admin/facets_helper_test.rb
workarea-admin-3.5.11 test/helpers/workarea/admin/facets_helper_test.rb
workarea-admin-3.5.10 test/helpers/workarea/admin/facets_helper_test.rb
workarea-admin-3.5.9 test/helpers/workarea/admin/facets_helper_test.rb
workarea-admin-3.5.8 test/helpers/workarea/admin/facets_helper_test.rb
workarea-admin-3.5.7 test/helpers/workarea/admin/facets_helper_test.rb