Sha256: a0fc0ca8144f3368e8573bd6abc7fc95a3bee4dc8dd497c5e0751fac6753171d

Contents?: true

Size: 642 Bytes

Versions: 9

Compression:

Stored size: 642 Bytes

Contents

module Spree
  module Core
    module TestingSupport
      module Flash
        def assert_flash_success(flash)
          flash = convert_flash(flash)

          within("[class='flash success']") do
            page.should have_content(flash)
          end
        end

        def assert_successful_update_message(resource)
          flash = I18n.t(:successfully_updated, :resource => I18n.t(resource))
          assert_flash_success(flash)
        end

        private

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

Version data entries

9 entries across 9 versions & 2 rubygems

Version Path
spree_core-1.3.5 lib/spree/core/testing_support/flash.rb
spree_core-1.3.4 lib/spree/core/testing_support/flash.rb
spree_core-1.3.3 lib/spree/core/testing_support/flash.rb
spree_core-1.3.2 lib/spree/core/testing_support/flash.rb
spree_core-1.3.1 lib/spree/core/testing_support/flash.rb
spree_core-1.3.0 lib/spree/core/testing_support/flash.rb
spree_core-1.3.0.rc2 lib/spree/core/testing_support/flash.rb
dup_spree_core-1.3.0.rc1 lib/spree/core/testing_support/flash.rb
spree_core-1.3.0.rc1 lib/spree/core/testing_support/flash.rb