module GovukPersonalisation::TestHelpers::Features

Public Instance Methods

mock_logged_in_session(session_id = "placeholder", flash = nil) click to toggle source

Set the `GOVUK-Account-Session` request header in the page driver.

@param session_id [String] the session identifier @param flash [Array<String>, nil] the flash messages

# File lib/govuk_personalisation/test_helpers/features.rb, line 9
def mock_logged_in_session(session_id = "placeholder", flash = nil)
  page.driver.header("GOVUK-Account-Session", GovukPersonalisation::Flash.encode_session(session_id, flash))
end