summaryrefslogtreecommitdiffstats
path: root/test/unit/lib
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2012-04-22 11:56:47 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2012-04-22 11:56:47 +0000
commitb960470d7817843906d42628d8bb4228ee49b2d9 (patch)
tree9c16e3fe4ae68e36e4d3c6c0dfebb267eab9a774 /test/unit/lib
parent4a3f038595922dc5fef9f3541363a16078a5ace9 (diff)
downloadredmine-b960470d7817843906d42628d8bb4228ee49b2d9.tar.gz
redmine-b960470d7817843906d42628d8bb4228ee49b2d9.zip
Removed object_daddy dependency.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@9469 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/unit/lib')
-rw-r--r--test/unit/lib/redmine/ciphering_test.rb20
-rw-r--r--test/unit/lib/redmine/helpers/gantt_test.rb1
2 files changed, 10 insertions, 11 deletions
diff --git a/test/unit/lib/redmine/ciphering_test.rb b/test/unit/lib/redmine/ciphering_test.rb
index 94d40116e..6d10f6abf 100644
--- a/test/unit/lib/redmine/ciphering_test.rb
+++ b/test/unit/lib/redmine/ciphering_test.rb
@@ -21,7 +21,7 @@ class Redmine::CipheringTest < ActiveSupport::TestCase
def test_password_should_be_encrypted
Redmine::Configuration.with 'database_cipher_key' => 'secret' do
- r = Repository::Subversion.generate!(:password => 'foo')
+ r = Repository::Subversion.create!(:password => 'foo', :url => 'file:///tmp', :identifier => 'svn')
assert_equal 'foo', r.password
assert r.read_attribute(:password).match(/\Aaes-256-cbc:.+\Z/)
end
@@ -29,7 +29,7 @@ class Redmine::CipheringTest < ActiveSupport::TestCase
def test_password_should_be_clear_with_blank_key
Redmine::Configuration.with 'database_cipher_key' => '' do
- r = Repository::Subversion.generate!(:password => 'foo')
+ r = Repository::Subversion.create!(:password => 'foo', :url => 'file:///tmp', :identifier => 'svn')
assert_equal 'foo', r.password
assert_equal 'foo', r.read_attribute(:password)
end
@@ -37,7 +37,7 @@ class Redmine::CipheringTest < ActiveSupport::TestCase
def test_password_should_be_clear_with_nil_key
Redmine::Configuration.with 'database_cipher_key' => nil do
- r = Repository::Subversion.generate!(:password => 'foo')
+ r = Repository::Subversion.create!(:password => 'foo', :url => 'file:///tmp', :identifier => 'svn')
assert_equal 'foo', r.password
assert_equal 'foo', r.read_attribute(:password)
end
@@ -45,7 +45,7 @@ class Redmine::CipheringTest < ActiveSupport::TestCase
def test_blank_password_should_be_clear
Redmine::Configuration.with 'database_cipher_key' => 'secret' do
- r = Repository::Subversion.generate!(:password => '')
+ r = Repository::Subversion.create!(:password => '', :url => 'file:///tmp', :identifier => 'svn')
assert_equal '', r.password
assert_equal '', r.read_attribute(:password)
end
@@ -53,7 +53,7 @@ class Redmine::CipheringTest < ActiveSupport::TestCase
def test_unciphered_password_should_be_readable
Redmine::Configuration.with 'database_cipher_key' => nil do
- r = Repository::Subversion.generate!(:password => 'clear')
+ r = Repository::Subversion.create!(:password => 'clear', :url => 'file:///tmp', :identifier => 'svn')
end
Redmine::Configuration.with 'database_cipher_key' => 'secret' do
@@ -64,7 +64,7 @@ class Redmine::CipheringTest < ActiveSupport::TestCase
def test_ciphered_password_with_no_cipher_key_configured_should_be_returned_ciphered
Redmine::Configuration.with 'database_cipher_key' => 'secret' do
- r = Repository::Subversion.generate!(:password => 'clear')
+ r = Repository::Subversion.create!(:password => 'clear', :url => 'file:///tmp', :identifier => 'svn')
end
Redmine::Configuration.with 'database_cipher_key' => '' do
@@ -79,8 +79,8 @@ class Redmine::CipheringTest < ActiveSupport::TestCase
def test_encrypt_all
Repository.delete_all
Redmine::Configuration.with 'database_cipher_key' => nil do
- Repository::Subversion.generate!(:password => 'foo')
- Repository::Subversion.generate!(:password => 'bar')
+ Repository::Subversion.create!(:password => 'foo', :url => 'file:///tmp', :identifier => 'foo')
+ Repository::Subversion.create!(:password => 'bar', :url => 'file:///tmp', :identifier => 'bar')
end
Redmine::Configuration.with 'database_cipher_key' => 'secret' do
@@ -94,8 +94,8 @@ class Redmine::CipheringTest < ActiveSupport::TestCase
def test_decrypt_all
Repository.delete_all
Redmine::Configuration.with 'database_cipher_key' => 'secret' do
- Repository::Subversion.generate!(:password => 'foo')
- Repository::Subversion.generate!(:password => 'bar')
+ Repository::Subversion.create!(:password => 'foo', :url => 'file:///tmp', :identifier => 'foo')
+ Repository::Subversion.create!(:password => 'bar', :url => 'file:///tmp', :identifier => 'bar')
assert Repository.decrypt_all(:password)
r = Repository.first(:order => 'id DESC')
diff --git a/test/unit/lib/redmine/helpers/gantt_test.rb b/test/unit/lib/redmine/helpers/gantt_test.rb
index 614bcfac7..b4f201a2b 100644
--- a/test/unit/lib/redmine/helpers/gantt_test.rb
+++ b/test/unit/lib/redmine/helpers/gantt_test.rb
@@ -160,7 +160,6 @@ class Redmine::Helpers::GanttHelperTest < ActionView::TestCase
context "assigned to a shared version of another project" do
setup do
p = Project.generate!
- p.trackers << @tracker
p.enabled_module_names = [:issue_tracking]
@shared_version = Version.generate!(:sharing => 'system')
p.versions << @shared_version