Sha256: 14ef2fa4bbcda55ee9534f738c578a1243b75da84973b8d861b33b11441d8ce5

Contents?: true

Size: 403 Bytes

Versions: 9

Compression:

Stored size: 403 Bytes

Contents

module Sorcery
  module TestHelpers
    module Rails
      # logins a user and calls all callbacks
      def login_user(user = nil)
        user ||= @user
        @controller.send(:login_user,user)
        @controller.send(:after_login!,user,[user.send(user.sorcery_config.username_attribute_name),'secret'])
      end

      def logout_user
        @controller.send(:logout)
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
sorcery-0.6.1 lib/sorcery/test_helpers/rails.rb
sorcery-0.6.0 lib/sorcery/test_helpers/rails.rb
sorcery-0.5.30 lib/sorcery/test_helpers/rails.rb
sorcery-0.5.3 lib/sorcery/test_helpers/rails.rb
sorcery-0.5.21 lib/sorcery/test_helpers/rails.rb
sorcery-0.5.2 lib/sorcery/test_helpers/rails.rb
sorcery-0.5.1 lib/sorcery/test_helpers/rails.rb
sorcery-0.5.0 lib/sorcery/test_helpers/rails.rb
sorcery-0.4.2 lib/sorcery/test_helpers/rails.rb