Module: Clearance::Testing::Helpers

Included in:
Test::Unit::TestCase
Defined in:
lib/clearance/testing/helpers.rb

Instance Method Summary collapse

Instance Method Details

#setup_controller_request_and_responseObject



17
18
19
20
# File 'lib/clearance/testing/helpers.rb', line 17

def setup_controller_request_and_response
  super
  @request.env[:clearance] = Clearance::Session.new(@request.env)
end

#sign_inObject



9
10
11
# File 'lib/clearance/testing/helpers.rb', line 9

def 
   Factory(:user)
end

#sign_in_as(user) ⇒ Object



4
5
6
7
# File 'lib/clearance/testing/helpers.rb', line 4

def (user)
  @controller.current_user = user
  return user
end

#sign_outObject



13
14
15
# File 'lib/clearance/testing/helpers.rb', line 13

def sign_out
  @controller.current_user = nil
end