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