diff options
author | Eric Davis <edavis@littlestreamsoftware.com> | 2009-10-19 00:07:37 +0000 |
---|---|---|
committer | Eric Davis <edavis@littlestreamsoftware.com> | 2009-10-19 00:07:37 +0000 |
commit | a150689be9281f3a814cd5bdedd42f80f431fe41 (patch) | |
tree | dc9f10c027d2f985aa36f47272a6b49ba38bbcd5 /test/test_helper.rb | |
parent | 6531c3f88721c083f32c3e313efec6b40708382a (diff) | |
download | redmine-a150689be9281f3a814cd5bdedd42f80f431fe41.tar.gz redmine-a150689be9281f3a814cd5bdedd42f80f431fe41.zip |
Improved Project#copy to copy more data from the source Project. #3367
* Versions
* Associate the copied issues with the new versions
* Wiki
* WikiPages
* WikiContents
* IssueCategories
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@2934 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/test_helper.rb')
-rw-r--r-- | test/test_helper.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/test/test_helper.rb b/test/test_helper.rb index 308b43097..37f8bfd00 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -21,6 +21,19 @@ require 'test_help' require File.expand_path(File.dirname(__FILE__) + '/helper_testcase') require File.join(RAILS_ROOT,'test', 'mocks', 'open_id_authentication_mock.rb') +# TODO: The gem or official version of ObjectDaddy doesn't set +# protected attributes so they need to be wrapped. +def User.generate_with_protected!(attributes={}) + user = User.spawn(attributes) do |user| + user.login = User.next_login + attributes.each do |attr,v| + user.send("#{attr}=", v) + end + end + user.save! + user +end + class ActiveSupport::TestCase # Transactional fixtures accelerate your tests by wrapping each test method # in a transaction that's rolled back on completion. This ensures that the |