Module: CacheableFlash::TestHelpers

Includes:
StackableFlash::TestHelpers
Included in:
RspecMatchers
Defined in:
lib/cacheable_flash/test_helpers.rb

Instance Method Summary collapse

Instance Method Details


9
10
11
12
13
14
# File 'lib/cacheable_flash/test_helpers.rb', line 9

def flash_cookie
  return {} unless cooked_flash = response.cookies['flash']
  JSON(cooked_flash)
rescue JSON::ParserError
  {}
end

16
17
18
19
20
21
# File 'lib/cacheable_flash/test_helpers.rb', line 16

def flash_cookie_for(response)
  return {} unless cooked_flash = response.cookies['flash']
  JSON(cooked_flash)
rescue JSON::ParserError
  {}
end