Sha256: 56aa166f512314ee62f45c0876212887aebca69f9cf809eb26f75d136e869dbb

Contents?: true

Size: 1.54 KB

Versions: 34

Compression:

Stored size: 1.54 KB

Contents

require 'test_helper'

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

      def test_admins_see_a_list_of_alerts
        create_product(images: [], description: nil)
        create_product(variants: [])
        create_product(variants: [{ sku: 'NODETAILS' }])
        create_product(
          variants: [
            { sku: 'ID1', details: { 'Color' => %w(red), 'Size' => %w(Large) } },
            { sku: 'ID2', details: { 'Color' => %w(blue) } }
          ]
        )
        create_category(product_ids: [], product_rules: [])
        create_release(name: 'Foo', publish_at: 1.hour.from_now)

        visit admin.root_path
        assert(page.has_content?('9 Alerts'))
        find('button', text: '9 Alerts').hover

        within '#alert_menu' do
          assert(page.has_content?('1 empty category'))
          assert(page.has_content?('3 products missing images'))
          assert(page.has_content?('3 products missing descriptions'))
          assert(page.has_content?('1 product missing variants'))
          assert(page.has_content?('3 products missing categories'))
          assert(page.has_content?('4 products with low inventory'))
          assert(page.has_content?('2 products with variants missing details'))
          assert(page.has_content?('1 product with inconsistent variant details'))
          assert_match(/Foo publishes on/, page.text)
        end

        click_link '1 product missing variants'

        assert_selector('.index-table__row', count: 1)
      end
    end
  end
end

Version data entries

34 entries across 34 versions & 1 rubygems

Version Path
workarea-admin-3.4.45 test/system/workarea/admin/alerts_system_test.rb
workarea-admin-3.4.44 test/system/workarea/admin/alerts_system_test.rb
workarea-admin-3.4.43 test/system/workarea/admin/alerts_system_test.rb
workarea-admin-3.4.42 test/system/workarea/admin/alerts_system_test.rb
workarea-admin-3.4.41 test/system/workarea/admin/alerts_system_test.rb
workarea-admin-3.4.40 test/system/workarea/admin/alerts_system_test.rb
workarea-admin-3.4.39 test/system/workarea/admin/alerts_system_test.rb
workarea-admin-3.4.38 test/system/workarea/admin/alerts_system_test.rb
workarea-admin-3.4.37 test/system/workarea/admin/alerts_system_test.rb
workarea-admin-3.4.36 test/system/workarea/admin/alerts_system_test.rb
workarea-admin-3.4.35 test/system/workarea/admin/alerts_system_test.rb
workarea-admin-3.4.34 test/system/workarea/admin/alerts_system_test.rb
workarea-admin-3.4.33 test/system/workarea/admin/alerts_system_test.rb
workarea-admin-3.4.32 test/system/workarea/admin/alerts_system_test.rb
workarea-admin-3.4.31 test/system/workarea/admin/alerts_system_test.rb
workarea-admin-3.4.30 test/system/workarea/admin/alerts_system_test.rb
workarea-admin-3.4.29 test/system/workarea/admin/alerts_system_test.rb
workarea-admin-3.4.28 test/system/workarea/admin/alerts_system_test.rb
workarea-admin-3.4.27 test/system/workarea/admin/alerts_system_test.rb
workarea-admin-3.4.26 test/system/workarea/admin/alerts_system_test.rb