Sha256: 8ffbde74b7f14e243fb28ba54c42f3a2b23f0cbd17c9b2f0e9580ce399dd8412

Contents?: true

Size: 414 Bytes

Versions: 1

Compression:

Stored size: 414 Bytes

Contents

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

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

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
sorcery-0.8.5 lib/sorcery/test_helpers/rails.rb