Skip to content

Instantly share code, notes, and snippets.

@databyte
Created October 24, 2011 06:01
Show Gist options
  • Save databyte/1308446 to your computer and use it in GitHub Desktop.
Save databyte/1308446 to your computer and use it in GitHub Desktop.
Speed up AuthLogic for specs
module SpecCryptoProvider
def self.encrypt(*tokens)
tokens.join("")
end
def self.matches?(crypted, *tokens)
encrypt(*tokens) == crypted
end
end
User.crypto_provider = SpecCryptoProvider
Guest.crypto_provider = SpecCryptoProvider
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment