Sha256: bb30849125319dfbd6503f7ec764c3ff746abb0b90d79a72b48821fbd32262ca

Contents?: true

Size: 616 Bytes

Versions: 62

Compression:

Stored size: 616 Bytes

Contents

require 'test_helper'

module Workarea
  class FindTaxonomySlugTest < TestCase
    def test_slug
      parent_taxon = create_taxon(name: 'Baz')

      navigable = create_category(name: 'Foo Bar')
      create_taxon(navigable: navigable, parent: parent_taxon)

      slug = FindTaxonomySlug.new(navigable).slug
      assert_equal('baz-foo-bar', slug)

      navigable.update_attributes!(slug: slug)
      navigable_two = create_category(name: 'Foo Bar')
      create_taxon(navigable: navigable_two, parent: parent_taxon)
      assert_equal('baz-foo-bar-1', FindTaxonomySlug.new(navigable_two).slug)
    end
  end
end

Version data entries

62 entries across 62 versions & 1 rubygems

Version Path
workarea-core-3.5.15 test/queries/workarea/find_taxonomy_slug_test.rb
workarea-core-3.4.36 test/queries/workarea/find_taxonomy_slug_test.rb
workarea-core-3.5.14 test/queries/workarea/find_taxonomy_slug_test.rb
workarea-core-3.4.35 test/queries/workarea/find_taxonomy_slug_test.rb
workarea-core-3.5.13 test/queries/workarea/find_taxonomy_slug_test.rb
workarea-core-3.4.34 test/queries/workarea/find_taxonomy_slug_test.rb
workarea-core-3.5.12 test/queries/workarea/find_taxonomy_slug_test.rb
workarea-core-3.4.33 test/queries/workarea/find_taxonomy_slug_test.rb
workarea-core-3.5.11 test/queries/workarea/find_taxonomy_slug_test.rb
workarea-core-3.5.10 test/queries/workarea/find_taxonomy_slug_test.rb
workarea-core-3.4.32 test/queries/workarea/find_taxonomy_slug_test.rb
workarea-core-3.5.9 test/queries/workarea/find_taxonomy_slug_test.rb
workarea-core-3.4.31 test/queries/workarea/find_taxonomy_slug_test.rb
workarea-core-3.5.8 test/queries/workarea/find_taxonomy_slug_test.rb
workarea-core-3.4.30 test/queries/workarea/find_taxonomy_slug_test.rb
workarea-core-3.5.7 test/queries/workarea/find_taxonomy_slug_test.rb
workarea-core-3.4.29 test/queries/workarea/find_taxonomy_slug_test.rb
workarea-core-3.5.6 test/queries/workarea/find_taxonomy_slug_test.rb
workarea-core-3.4.28 test/queries/workarea/find_taxonomy_slug_test.rb
workarea-core-3.5.5 test/queries/workarea/find_taxonomy_slug_test.rb