summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>2014-01-09 04:23:03 +0000
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>2014-01-09 04:23:03 +0000
commit132021f8951b1910cfddb83d8be34bb95de1e8f8 (patch)
tree3820ab8faaab79657c45ca073c529281a0f6f8af
parentbb54f0b7c5ff039aa5a4b6200ed2b2d551848601 (diff)
downloadredmine-132021f8951b1910cfddb83d8be34bb95de1e8f8.tar.gz
redmine-132021f8951b1910cfddb83d8be34bb95de1e8f8.zip
Rails4: replace deprecated Relation#first with finder options at CipheringTest
git-svn-id: http://svn.redmine.org/redmine/trunk@12550 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r--test/unit/lib/redmine/ciphering_test.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/test/unit/lib/redmine/ciphering_test.rb b/test/unit/lib/redmine/ciphering_test.rb
index 58ae54fb2..c5b9cae1a 100644
--- a/test/unit/lib/redmine/ciphering_test.rb
+++ b/test/unit/lib/redmine/ciphering_test.rb
@@ -57,7 +57,7 @@ class Redmine::CipheringTest < ActiveSupport::TestCase
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
@@ -68,7 +68,7 @@ class Redmine::CipheringTest < ActiveSupport::TestCase
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/)
@@ -85,7 +85,7 @@ class Redmine::CipheringTest < ActiveSupport::TestCase
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
@@ -98,7 +98,7 @@ class Redmine::CipheringTest < ActiveSupport::TestCase
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