end
Redmine::Configuration.with 'database_cipher_key' => 'secret' do
- r = Repository.first(:order => 'id DESC')
+ r = Repository.order('id DESC').first
assert_equal 'clear', r.password
end
end
end
Redmine::Configuration.with 'database_cipher_key' => '' do
- r = Repository.first(:order => 'id DESC')
+ r = Repository.order('id DESC').first
# password can not be deciphered
assert_nothing_raised do
assert r.password.match(/\Aaes-256-cbc:.+\Z/)
Redmine::Configuration.with 'database_cipher_key' => 'secret' do
assert Repository.encrypt_all(:password)
- r = Repository.first(:order => 'id DESC')
+ r = Repository.order('id DESC').first
assert_equal 'bar', r.password
assert r.read_attribute(:password).match(/\Aaes-256-cbc:.+\Z/)
end
Repository::Subversion.create!(:password => 'bar', :url => 'file:///tmp', :identifier => 'bar')
assert Repository.decrypt_all(:password)
- r = Repository.first(:order => 'id DESC')
+ r = Repository.order('id DESC').first
assert_equal 'bar', r.password
assert_equal 'bar', r.read_attribute(:password)
end