diff options
author | Eric Davis <edavis@littlestreamsoftware.com> | 2010-02-08 18:53:12 +0000 |
---|---|---|
committer | Eric Davis <edavis@littlestreamsoftware.com> | 2010-02-08 18:53:12 +0000 |
commit | 81ee2ff884c832859d4b635b72472c9724c5d5cc (patch) | |
tree | 0410ee17c9c0591df9f7267d0bc192796844da9a /test/object_daddy_helpers.rb | |
parent | 9482831313024635e47c2a434020f6e20c0a9d4a (diff) | |
download | redmine-81ee2ff884c832859d4b635b72472c9724c5d5cc.tar.gz redmine-81ee2ff884c832859d4b635b72472c9724c5d5cc.zip |
Updated object_daddy to a newer version (bugfixes)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3398 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/object_daddy_helpers.rb')
-rw-r--r-- | test/object_daddy_helpers.rb | 24 |
1 files changed, 5 insertions, 19 deletions
diff --git a/test/object_daddy_helpers.rb b/test/object_daddy_helpers.rb index ce6e00bd7..4a2b85a9e 100644 --- a/test/object_daddy_helpers.rb +++ b/test/object_daddy_helpers.rb @@ -1,30 +1,16 @@ module ObjectDaddyHelpers - # TODO: The gem or official version of ObjectDaddy doesn't set - # protected attributes so they need to be wrapped. + # TODO: Remove these three once everyone has ported their code to use the + # new object_daddy version with protected attribute support def User.generate_with_protected(attributes={}) - user = User.spawn_with_protected(attributes) - user.save - user + User.generate(attributes) end - # 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_with_protected(attributes) - user.save! - user + User.generate!(attributes) end - # TODO: The gem or official version of ObjectDaddy doesn't set - # protected attributes so they need to be wrapped. def User.spawn_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 + User.spawn(attributes) end # Generate the default Query |