Sha256: e6a420f59ecca7661c457bafade5a42c1b38015ac1b20bf0ca7a3d78a97f5eb3

Contents?: true

Size: 398 Bytes

Versions: 3

Compression:

Stored size: 398 Bytes

Contents

require 'json'

module CacheableFlash
  module TestHelpers

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

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

  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
cacheable_flash-1.0.0 lib/cacheable_flash/test_helpers.rb
cacheable_flash-0.3.4 lib/cacheable_flash/test_helpers.rb
cacheable_flash-0.3.3 lib/cacheable_flash/test_helpers.rb