Sha256: ef0a8c96ab7773d1b567795eed393cf1442228a6e48247e0c8888a572df53c34
Contents?: true
Size: 808 Bytes
Versions: 32
Compression:
Stored size: 808 Bytes
Contents
module Clearance module Testing # Provides helpers to your view and helper specs. # Using these helpers makes `current_user`, `signed_in?` and `signed_out?` # behave properly in view and helper specs. module ViewHelpers # Sets current_user on the view under test to a new instance of your user # model. def sign_in view.current_user = Clearance.configuration.user_model.new end # Sets current_user on the view under test to the supplied user. def sign_in_as(user) view.current_user = user end # @api private module CurrentUser attr_accessor :current_user def signed_in? current_user.present? end def signed_out? !signed_in? end end end end end
Version data entries
32 entries across 32 versions & 1 rubygems