Module: Brut::SpecSupport::FlashSupport

Included in:
ComponentSupport, HandlerSupport
Defined in:
lib/brut/spec_support/flash_support.rb

Overview

Convienience methods for using a Flash inside tests.

Instance Method Summary collapse

Instance Method Details

#empty_flashObject

Create a normal empty flash, using the app's configured class.



4
# File 'lib/brut/spec_support/flash_support.rb', line 4

def empty_flash = Brut.container.flash_class.new

#flash_from(hash) ⇒ Object

Create a flash using the app's configured class that contains the given hash as its values.

Parameters:

  • hash (Hash)

    Values to include in the Flash.



9
10
11
# File 'lib/brut/spec_support/flash_support.rb', line 9

def flash_from(hash)
  Brut.container.flash_class.from_h(messages: hash)
end