Module: CacheableFlash::TestHelpers

Included in:
RspecMatchers
Defined in:
lib/cacheable_flash/test_helpers.rb

Instance Method Summary collapse

Instance Method Details


6
7
8
9
10
11
# File 'lib/cacheable_flash/test_helpers.rb', line 6

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

13
14
15
16
17
18
# File 'lib/cacheable_flash/test_helpers.rb', line 13

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