Module: Clearance::Testing::Helpers

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

Instance Method Summary collapse

Instance Method Details

#setup_controller_request_and_responseObject



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

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 
   FactoryGirl.create(:user)
end

#sign_in_as(user) ⇒ Object



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

def (user)
  @controller.current_user = user
end

#sign_outObject



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

def sign_out
  @controller.sign_out
end