module GovukPersonalisation::TestHelpers::Requests
Public Instance Methods
mock_logged_in_session(session_id = "placeholder", flash = nil)
click to toggle source
Set the `GOVUK-Account-Session` request header.
@param session_id [String] the session identifier @param flash [Array<String>, nil] the flash messages
# File lib/govuk_personalisation/test_helpers/requests.rb, line 8 def mock_logged_in_session(session_id = "placeholder", flash = nil) request.headers["GOVUK-Account-Session"] = GovukPersonalisation::Flash.encode_session(session_id, flash) end