test/mongoid_test.rb in symmetric-encryption-4.1.0.beta1 vs test/mongoid_test.rb in symmetric-encryption-4.1.0
- old
+ new
@@ -83,21 +83,21 @@
@user = MongoidUser.new(
encrypted_bank_account_number: @bank_account_number_encrypted,
encrypted_social_security_number: @social_security_number_encrypted,
name: 'Joe Bloggs',
# data type specific fields
- integer_value: @integer_value,
- aliased_integer_value: @integer_value,
- float_value: @float_value,
- decimal_value: @decimal_value,
- datetime_value: @datetime_value,
- time_value: @time_value,
- date_value: @date_value,
- true_value: true,
- false_value: false,
- data_yaml: @h.dup,
- data_json: @h.dup
+ integer_value: @integer_value,
+ aliased_integer_value: @integer_value,
+ float_value: @float_value,
+ decimal_value: @decimal_value,
+ datetime_value: @datetime_value,
+ time_value: @time_value,
+ date_value: @date_value,
+ true_value: true,
+ false_value: false,
+ data_yaml: @h.dup,
+ data_json: @h.dup
)
end
it 'have encrypted methods' do
assert_equal true, @user.respond_to?(:encrypted_bank_account_number)
@@ -142,20 +142,20 @@
assert_equal @social_security_number_encrypted, @user.encrypted_social_security_number
end
it 'support same iv' do
@user.social_security_number = @social_security_number
- assert first_value = @user.social_security_number
+ assert first_value = @user.social_security_number
# Assign the same value
@user.social_security_number = @social_security_number
assert_equal first_value, @user.social_security_number
end
it 'support a random iv' do
- @user.string = @string
+ @user.string = @string
assert first_value = @user.encrypted_string
- @user.string = 'blah'
- @user.string = @string.dup
+ @user.string = 'blah'
+ @user.string = @string.dup
refute_equal first_value, @user.encrypted_string
end
it 'support a random iv and compress' do
@user.string = @long_string