Sha256: 74adcbc825d75b2f43ce05b5b6348a76bb27fab9459540f0866bae1f83d3c425

Contents?: true

Size: 860 Bytes

Versions: 62

Compression:

Stored size: 860 Bytes

Contents

require 'test_helper'

module Workarea
  class Metadata
    class HomePageTest < TestCase
      setup :set_home_page
      setup :create_menus

      def set_home_page
        @home_page = create_content(name: 'home')
      end

      def create_menus
        4.times do |i|
          menu = create_menu(name: "Foo-#{i}")
          Metrics::MenuByDay.inc(key: { menu_id: menu.id }, orders: i)
        end
      end

      def test_title
        metadata = Metadata::HomePage.new(@home_page)
        assert_equal('Shop Foo-3, Foo-2, Foo-1, and Foo-0', metadata.title)
      end

      def test_description
        metadata = Metadata::HomePage.new(@home_page)
        assert_equal(
          "Shop #{Workarea.config.site_name} for a great selection including Foo-3, Foo-2, Foo-1, and Foo-0",
          metadata.description
        )
      end
    end
  end
end

Version data entries

62 entries across 62 versions & 1 rubygems

Version Path
workarea-core-3.5.27 test/queries/workarea/metadata/home_page_test.rb
workarea-core-3.5.26 test/queries/workarea/metadata/home_page_test.rb
workarea-core-3.4.45 test/queries/workarea/metadata/home_page_test.rb
workarea-core-3.5.25 test/queries/workarea/metadata/home_page_test.rb
workarea-core-3.5.23 test/queries/workarea/metadata/home_page_test.rb
workarea-core-3.4.44 test/queries/workarea/metadata/home_page_test.rb
workarea-core-3.5.22 test/queries/workarea/metadata/home_page_test.rb
workarea-core-3.4.43 test/queries/workarea/metadata/home_page_test.rb
workarea-core-3.5.21 test/queries/workarea/metadata/home_page_test.rb
workarea-core-3.4.42 test/queries/workarea/metadata/home_page_test.rb
workarea-core-3.5.20 test/queries/workarea/metadata/home_page_test.rb
workarea-core-3.4.41 test/queries/workarea/metadata/home_page_test.rb
workarea-core-3.5.19 test/queries/workarea/metadata/home_page_test.rb
workarea-core-3.4.40 test/queries/workarea/metadata/home_page_test.rb
workarea-core-3.5.18 test/queries/workarea/metadata/home_page_test.rb
workarea-core-3.4.39 test/queries/workarea/metadata/home_page_test.rb
workarea-core-3.5.17 test/queries/workarea/metadata/home_page_test.rb
workarea-core-3.4.38 test/queries/workarea/metadata/home_page_test.rb
workarea-core-3.5.16 test/queries/workarea/metadata/home_page_test.rb
workarea-core-3.4.37 test/queries/workarea/metadata/home_page_test.rb