test/mongoid_test.rb in symmetric-encryption-3.9.1 vs test/mongoid_test.rb in symmetric-encryption-4.0.0.beta3
- 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)
@@ -151,12 +151,12 @@
end
it 'support a random iv' do
@user.string = @string
assert first_value = @user.encrypted_string
- # Assign the same value
+ @user.string = 'blah'
@user.string = @string.dup
- assert_equal true, first_value != @user.encrypted_string
+ refute_equal first_value, @user.encrypted_string
end
it 'support a random iv and compress' do
@user.string = @long_string
@user.long_string = @long_string