Sha256: f6d6969dbad18828c881cef029dc5a57abc8c771a008023f34a6c93b3b46b2a9

Contents?: true

Size: 537 Bytes

Versions: 3

Compression:

Stored size: 537 Bytes

Contents

# frozen-string-literal: true
require "test_helper"

class EncryptedFormFieldsTest < MiniTest::Unit::TestCase
  def test_encrypting_parameters
    hash = EncryptedFormFields.encrypt_parameters("foo" => "bar")
    decrypted = EncryptedFormFields.decrypt_and_verify(hash["foo"])
    assert_equal("bar", decrypted)
  end

  def test_decrypting_parameters
    value = EncryptedFormFields.encrypt_and_sign("bar")
    hash = EncryptedFormFields.decrypt_parameters("foo" => { "0" => value })
    assert_equal("bar", hash["foo"]["0"])
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
encrypted_form_fields-1.0.0 test/encrypted_form_fields_test.rb
encrypted_form_fields-0.2.4 test/encrypted_form_fields_test.rb
encrypted_form_fields-0.2.3 test/encrypted_form_fields_test.rb