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.25 test/system/workarea/admin/alerts_system_test.rb
workarea-admin-3.4.24 test/system/workarea/admin/alerts_system_test.rb
workarea-admin-3.4.23 test/system/workarea/admin/alerts_system_test.rb
workarea-admin-3.4.22 test/system/workarea/admin/alerts_system_test.rb
workarea-admin-3.4.21 test/system/workarea/admin/alerts_system_test.rb
workarea-admin-3.4.20 test/system/workarea/admin/alerts_system_test.rb
workarea-admin-3.4.19 test/system/workarea/admin/alerts_system_test.rb
workarea-admin-3.4.18 test/system/workarea/admin/alerts_system_test.rb
workarea-admin-3.4.17 test/system/workarea/admin/alerts_system_test.rb
workarea-admin-3.4.16 test/system/workarea/admin/alerts_system_test.rb
workarea-admin-3.4.15 test/system/workarea/admin/alerts_system_test.rb
workarea-admin-3.4.14 test/system/workarea/admin/alerts_system_test.rb
workarea-admin-3.4.13 test/system/workarea/admin/alerts_system_test.rb
workarea-admin-3.4.12 test/system/workarea/admin/alerts_system_test.rb