Sha256: 44d2eddf081642730d13d26a1565471005ecf758089df7cf1bf9a9245f90b7a7

Contents?: true

Size: 1.11 KB

Versions: 16

Compression:

Stored size: 1.11 KB

Contents

module Spree
  module Backend
    module TestingSupport
      module Flash
        def assert_admin_flash_alert_success(message)
          message_content = convert_flash(message)

          within('#FlashAlertsContainer', visible: :all) do
            expect(page).to have_css('span[data-alert-type="success"]', text: message_content, visible: :all)
          end
        end

        def assert_admin_flash_alert_error(message)
          message_content = convert_flash(message)

          within('#FlashAlertsContainer', visible: :all) do
            expect(page).to have_css('span[data-alert-type="error"]', text: message_content, visible: :all)
          end
        end

        def assert_admin_flash_alert_notice(message)
          message_content = convert_flash(message)

          within('#FlashAlertsContainer', visible: :all) do
            expect(page).to have_css('span[data-alert-type="notice"]', text: message_content, visible: :all)
          end
        end

        private

        def convert_flash(flash)
          flash = Spree.t(flash) if flash.is_a?(Symbol)
          flash
        end
      end
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
spree_backend-4.8.4 lib/spree/backend/testing_support/flash.rb
spree_backend-4.8.3 lib/spree/backend/testing_support/flash.rb
spree_backend-4.8.2 lib/spree/backend/testing_support/flash.rb
spree_backend-4.8.1 lib/spree/backend/testing_support/flash.rb
spree_backend-4.7.2 lib/spree/backend/testing_support/flash.rb
spree_backend-4.6.2 lib/spree/backend/testing_support/flash.rb
spree_backend-4.7.1 lib/spree/backend/testing_support/flash.rb
spree_backend-4.7.0 lib/spree/backend/testing_support/flash.rb
spree_backend-4.6.1 lib/spree/backend/testing_support/flash.rb
spree_backend-4.6.0 lib/spree/backend/testing_support/flash.rb
spree_backend-4.5.1 lib/spree/backend/testing_support/flash.rb
spree_backend-4.5.0 lib/spree/backend/testing_support/flash.rb
spree_backend-4.4.1 lib/spree/backend/testing_support/flash.rb
spree_backend-4.4.0 lib/spree/backend/testing_support/flash.rb
spree_backend-4.4.0.rc2 lib/spree/backend/testing_support/flash.rb
spree_backend-4.4.0.rc1 lib/spree/backend/testing_support/flash.rb