Module: Workarea::TestCase::Encryption

Extended by:
ActiveSupport::Concern
Included in:
IntegrationTest, MailerTest, PerformanceTest, SystemTest, Workarea::TestCase
Defined in:
lib/workarea/test_case.rb

Instance Method Summary collapse

Instance Method Details

#ensure_encryption_key(key: ActiveSupport::EncryptedFile.generate_key) ⇒ Object



211
212
213
214
215
# File 'lib/workarea/test_case.rb', line 211

def ensure_encryption_key(key: ActiveSupport::EncryptedFile.generate_key)
  env_key = Mongoid::Encrypted.configuration.env_key
  @original_key = ENV[env_key]
  ENV[env_key] ||= key
end

#reset_encryption_keyObject



217
218
219
# File 'lib/workarea/test_case.rb', line 217

def reset_encryption_key
  ENV[Mongoid::Encrypted.configuration.env_key] = @original_key
end