Object Daddy, plugins and test

Added by Alexey Palazhchenko almost 8 years ago

Hi all,

I have weird problems running Redmine tests with installed plugins. For example:

 10) Error:
test_Generating_with_object_daddy(TestingTest):
NoMethodError: undefined method `generate!' for #<Class:0xb6e88bac>
    /test/unit/testing_test.rb:32:in `test_Generating_with_object_daddy'
    /test/unit/testing_test.rb:31:in `test_Generating_with_object_daddy'

Any ideas how to fix it?

Replies (5)

RE: Object Daddy, plugins and test - Added by Jeffrey Jones almost 8 years ago

Possibly silly question. Have you installed the gems needed by ObjectDaddy?

RE: Object Daddy, plugins and test - Added by Alexey Palazhchenko almost 8 years ago

Yes. Redmine without any plugins passes all tests. With installed plugin Redmine's tests are broken.

RE: Object Daddy, plugins and test - Added by Lucas Nunes over 7 years ago

I'm having the same problem here. Here are my specs:

Debian Squeeze Linux kernel 2.6.32-trunk-686

Ruby 1.8.7 (2010-01-10 patchlevel 249) [i486-linux]
Redmine: 0.9.3

Installed gems:
actionmailer (2.3.5, 2.3.4, 2.3.3, 2.3.2, 2.2.2)
actionpack (2.3.5, 2.3.4, 2.3.3, 2.3.2, 2.2.2)
activerecord (2.3.5, 2.3.4, 2.3.3, 2.3.2, 2.2.2)
activeresource (2.3.5, 2.3.4, 2.3.3, 2.3.2, 2.2.2)
activesupport (2.3.5, 2.3.4, 2.3.3, 2.3.2, 2.2.2)
acts_as_paranoid (0.3.1)
acts_as_reportable (1.1.1)
acts_as_versioned (0.2.3)
archive-tar-minitar (0.5.2)
bleak_house (7.2, 4.5)
builder (2.1.2)
calendar_date_select (1.16.1, 1.15)
cgi_multipart_eof_fix (2.5.0)
color (1.4.1, 1.4.0)
columnize (0.3.1, 0.3.0, 0.2)
daemons (1.0.10)
dust (0.1.6)
edavis10-object_daddy (0.4.3)
eventmachine (0.12.10, 0.12.8)
facets (2.8.2, 2.8.1, 2.8.0, 2.7.0, 2.6.0, 2.5.2, 2.5.1, 2.5.0)
fast_gettext (0.5.1)
fastercsv (1.5.3, 1.5.1, 1.5.0, 1.4.0, 1.2.3)
fastthread (1.0.7)
ffi (0.6.3)
flay (1.4.0)
flog (2.4.0, 2.2.0)
gem_plugin (0.2.3)
gemcutter (0.5.0, 0.4.1)
gettext (2.1.0)
gosu (0.7.18, 0.7.15, 0.7.14)
grosser-i18n_data (0.2.3)
gruff (0.3.6, 0.3.4)
haml (2.2.22, 2.2.20, 2.2.17, 2.2.15, 2.2.14, 2.2.6, 2.2.5, 2.2.3, 2.2.2, 2.2.1, 2.0.9, 2.0.8, 2.0.6, 2.0.5)
heckle (1.4.3)
hoe (2.6.0, 2.5.0, 2.3.3, 2.3.2, 1.12.2, 1.12.1, 1.11.0, 1.10.0, 1.8.3, 1.8.2)
hpricot (0.8.2, 0.8.1, 0.6.164)
htmlentities (4.2.1, 4.2.0, 4.1.0, 4.0.0)
jscruggs-metric_fu (1.1.5)
json_pure (1.2.3, 1.2.2, 1.2.0)
libxml-ruby (1.1.3)
linecache (0.43)
locale (2.0.5)
mailfactory (1.4.0)
mime-types (1.16, 1.15)
mocha (0.9.8, 0.9.7, 0.9.5)
mojombo-chronic (0.3.0)
mongrel (1.1.5)
mongrel_cluster (1.0.5)
mysql (2.8.1, 2.7)
nitpick (1.0.2)
object_daddy (0.4.3)
ParseTree (3.0.5, 3.0.4, 3.0.3, 3.0.2, 3.0.1)
pdf-writer (1.1.8)
polyglot (0.3.1, 0.3.0, 0.2.9, 0.2.8, 0.2.6, 0.2.5, 0.2.4, 0.2.3)
postgres-pr (0.6.3, 0.6.1, 0.5.1, 0.5.0, 0.4.0)
prawn (0.8.4, 0.7.1)
prawn-core (0.8.4, 0.7.1)
prawn-layout (0.8.4, 0.7.1)
prawn-security (0.8.4, 0.7.1)
rack (1.1.0, 1.0.1, 1.0.0)
rails (2.3.5, 2.3.4, 2.3.3, 2.3.2, 2.2.2)
rake (0.8.7, 0.8.4, 0.8.3)
rb-inotify (0.7.1)
rcov (0.9.8, 0.9.7.1, 0.9.6, 0.8.1.2.0)
reek (1.2.7.3, 1.2.7.2, 1.2.7.1, 1.2.6, 1.2.5, 1.2.0)
relevance-rcov (0.9.2.1)
relevance-tarantula (0.3.3, 0.2.1, 0.2.0, 0.1.7)
roodi (2.1.0, 2.0.1, 2.0.0, 1.4.0, 1.3.5, 1.3.2, 1.3.0)
rspec (1.3.0)
ruby-debug (0.10.3)
ruby-debug-base (0.10.3, 0.10.2)
ruby-debug-ide (0.4.9, 0.4.7, 0.4.6, 0.4.5, 0.4.4, 0.3.4, 0.3.1)
ruby-prof (0.8.1, 0.7.10, 0.7.6, 0.7.3)
ruby2ruby (1.2.4)
ruby_parser (2.0.4, 2.0.3, 2.0.2)
rubyforge (2.0.4, 2.0.3, 2.0.0, 1.0.4, 1.0.3, 1.0.2)
rubygems-update (1.3.6, 1.3.5, 1.3.4, 1.3.3, 1.3.1)
RubyInline (3.8.4, 3.8.3, 3.8.2, 3.8.1)
rubyzip (0.9.4, 0.9.1)
ruport (1.6.3, 1.6.1)
ruport-util (0.14.0)
rvm (0.1.26, 0.1.24, 0.1.20, 0.1.3, 0.0.999, 0.0.86, 0.0.82, 0.0.52, 0.0.48, 0.0.37, 0.0.30)
scruffy (0.2.6, 0.2.5)
sexp_processor (3.0.4, 3.0.3, 3.0.2, 3.0.1, 3.0.0)
shoulda (2.10.3)
tattle (1.0.3)
thin (1.2.7, 1.2.5, 1.2.4, 1.2.2)
thoughtbot-shoulda (2.10.2)
transaction-simple (1.4.0)
treetop (1.4.5, 1.4.4, 1.4.3, 1.4.2, 1.4.1, 1.3.0, 1.2.6, 1.2.5, 1.2.4)
trestle_generator (1.1.7.3)
trollop (1.16.2, 1.15)
ZenTest (4.3.1, 4.3.0, 4.2.1, 4.1.4, 4.1.3, 4.0.0, 3.11.1, 3.11.0)

RE: Object Daddy, plugins and test - Added by Lucas Nunes over 7 years ago

Update: I managed to remove the errors by changing the model patches loading order, specifically my "UserPatch" module, which is responsible for some patching in the User model, was loading first.

Before:

Dispatcher.to_prepare do
  User.send(:include, UserPatch)
  Watcher.send(:include, WatcherPatch)
  Issue.send(:include, IssuePatch)
  Journal.send(:include, JournalPatch)
end

After:

Dispatcher.to_prepare do
  Watcher.send(:include, WatcherPatch)
  Issue.send(:include, IssuePatch)
  Journal.send(:include, JournalPatch)
  User.send(:include, UserPatch)
end

After that the "undefined method `generate!'" errors were gone.

RE: Object Daddy, plugins and test - Added by Alexey Palazhchenko over 7 years ago

And in my case it was double plugin initialization: I had both redmine_test_plugin/init.rb and redmine_test_plugin/rails/init.rb. Several other plugins has this issue too.

(1-5/5)