Sha256: 23416f58d8dd61e45979bd758bbafb6eb034853fba805baf42ee61ede649a525

Contents?: true

Size: 620 Bytes

Versions: 7

Compression:

Stored size: 620 Bytes

Contents

module Clearance 
  module Test
    module TestHelper
    
      def self.included(test_helper)
        test_helper.class_eval do
          
          def sign_in_as(user = nil)
            unless user
              user = Factory(:registered_user)
              user.confirm_email!
            end
            @request.session[:user_id] = user.id
            @request.session[:salt]    = user.salt
            return user
          end

          def sign_out 
            @request.session[:user_id] = nil
            @request.session[:salt]    = nil
          end
          
        end
      end
 
    end 
  end
end

Version data entries

7 entries across 7 versions & 3 rubygems

Version Path
gsterndale-warrant-0.2.0 test/rails_root/vendor/gems/thoughtbot-clearance-0.4.0/lib/clearance/test/test_helper.rb
nagybence-clearance-0.4.1 lib/clearance/test/test_helper.rb
nagybence-clearance-0.4.2 lib/clearance/test/test_helper.rb
thoughtbot-clearance-0.4.0 lib/clearance/test/test_helper.rb
thoughtbot-clearance-0.4.1 lib/clearance/test/test_helper.rb
thoughtbot-clearance-0.4.2 lib/clearance/test/test_helper.rb
thoughtbot-clearance-0.4.3 lib/clearance/test/test_helper.rb