Sha256: 92e4178d3118a7f4c64b456a34e7b87bf1af237831a7658f01d3c5100f1746ee

Contents?: true

Size: 1.48 KB

Versions: 28

Compression:

Stored size: 1.48 KB

Contents

require 'test_helper'

module Workarea
  module Admin
    class FeaturedProductsSystemTest < SystemTest
      include Admin::IntegrationTest

      def test_managing_featured_products
        create_product(name: 'Foo')
        create_product(name: 'Bar')
        create_product(name: 'Baz', active: false)
        category = create_category
        visit admin.catalog_category_path(category)

        click_link t('workarea.admin.catalog_categories.cards.featured_products.title')
        assert(page.has_content?('Foo'))
        assert(page.has_content?('Bar'))
        assert(page.has_content?('Baz'))
        assert(page.has_content?(t('workarea.admin.featured_products.statuses.inactive')))

        click_link 'Foo'
        assert(page.has_content?('Success'))
        assert(page.has_selector?('.product-summary__remove'))
        click_link t('workarea.admin.featured_products.select.sort_link')

        assert(page.has_content?('Foo'))
        assert(page.has_no_content?('Bar'))
        click_link t('workarea.admin.featured_products.edit.browse_link')

        assert(page.has_selector?('.product-summary__remove'))
        click_link 'Foo'
        assert(page.has_content?('Success'))
        assert(page.has_no_selector?('.product-summary__remove'))
        click_link t('workarea.admin.featured_products.select.sort_link')

        assert(page.has_no_content?('Foo'))
        assert(page.has_no_content?('Bar'))
        assert(page.has_no_selector?('#product_ids_'))
      end
    end
  end
end

Version data entries

28 entries across 28 versions & 1 rubygems

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