Defect #30171 » test-for-30171.diff
| test/unit/lib/redmine/ciphering_test.rb (working copy) | ||
|---|---|---|
|
def test_password_should_be_encrypted
|
||
|
Redmine::Configuration.with 'database_cipher_key' => 'secret' do
|
||
|
r = Repository::Subversion.create!(:password => 'foo', :url => 'file:///tmp', :identifier => 'svn')
|
||
|
assert_equal 'foo', r.password
|
||
|
plaintext_password = "THIS-IS-A-32-BYTES-LONG-PASSWORD"
|
||
|
r = Repository::Subversion.create!(:password => plaintext_password, :url => 'file:///tmp', :identifier => 'svn')
|
||
|
assert_equal plaintext_password, r.password
|
||
|
assert r.read_attribute(:password).match(/\Aaes-256-cbc:.+\Z/)
|
||
|
end
|
||
|
end
|
||
- « Previous
- 1
- 2
- Next »