Class: FocusedController::TestRequest

Inherits:
ActionDispatch::TestRequest
  • Object
show all
Defined in:
lib/focused_controller/test_helper.rb

Instance Method Summary collapse

Constructor Details

#initialize(env = {}) ⇒ TestRequest

Returns a new instance of TestRequest.



17
18
19
20
# File 'lib/focused_controller/test_helper.rb', line 17

def initialize(env = {})
  super
  self.session = HashWithIndifferentAccess.new
end

Instance Method Details



22
23
24
# File 'lib/focused_controller/test_helper.rb', line 22

def cookie_jar
  @cookie_jar ||= ActionDispatch::Cookies::CookieJar.build(self)
end

#flashObject



26
27
28
# File 'lib/focused_controller/test_helper.rb', line 26

def flash
  session['flash'] ||= ActionDispatch::Flash::FlashHash.new
end