diaspora/spec/lib/encryptor_spec.rb
2010-11-01 14:54:40 -07:00

21 lines
551 B
Ruby

# Copyright (c) 2010, Diaspora Inc. This file is
# licensed under the Affero General Public License version 3 or later. See
# the COPYRIGHT file.
require 'spec_helper'
describe 'user encryption' do
before do
@user = make_user
@aspect = @user.aspects.create(:name => 'dudes')
end
describe 'encryption' do
it 'should encrypt a string' do
string = "Secretsauce"
ciphertext = @user.encrypt string
ciphertext.include?(string).should be false
@user.decrypt(ciphertext).should == string
end
end
end