elight/acts_as_commentable_with_threading

How to get commendable tests to run on it's own in Gem?

Closed this issue · 1 comments

If you checkout the gem, how do you get the second test file to pass? From my output it seems that it's not connecting to the database. Upon investigation it looks like the spec_helper.rb should be setting up a connection.

Anyone have an idea of what's wrong? Anything I'm missing?

rake spec
rake/gempackagetask is deprecated.  Use rubygems/package_task instead
............FFFFFF

1)
ActiveRecord::UnknownAttributeError in 'A class that is commentable special class finders#find_comments_for should return the comments for the passed commentable'
unknown attribute: commentable
/Users/Armageddon/.rvm/gems/ruby-1.9.2-p180-patched@acts_as_commentable_with_threading/gems/activerecord-3.1.1/lib/active_record/base.rb:1753:in `block in assign_attributes'
/Users/Armageddon/.rvm/gems/ruby-1.9.2-p180-patched@acts_as_commentable_with_threading/gems/activerecord-3.1.1/lib/active_record/base.rb:1747:in `each'
/Users/Armageddon/.rvm/gems/ruby-1.9.2-p180-patched@acts_as_commentable_with_threading/gems/activerecord-3.1.1/lib/active_record/base.rb:1747:in `assign_attributes'
/Users/Armageddon/.rvm/gems/ruby-1.9.2-p180-patched@acts_as_commentable_with_threading/gems/activerecord-3.1.1/lib/active_record/base.rb:1567:in `initialize'
/Users/Armageddon/.rvm/gems/ruby-1.9.2-p180-patched@acts_as_commentable_with_threading/gems/activerecord-3.1.1/lib/active_record/validations.rb:39:in `new'
/Users/Armageddon/.rvm/gems/ruby-1.9.2-p180-patched@acts_as_commentable_with_threading/gems/activerecord-3.1.1/lib/active_record/validations.rb:39:in `create!'
spec/commentable_spec.rb:17:in `block (4 levels) in <top (required)>'

2)
ActiveRecord::UnknownAttributeError in 'A class that is commentable special class finders#find_comments_for should not return the comments for other commentables'
unknown attribute: commentable
/Users/Armageddon/.rvm/gems/ruby-1.9.2-p180-patched@acts_as_commentable_with_threading/gems/activerecord-3.1.1/lib/active_record/base.rb:1753:in `block in assign_attributes'
/Users/Armageddon/.rvm/gems/ruby-1.9.2-p180-patched@acts_as_commentable_with_threading/gems/activerecord-3.1.1/lib/active_record/base.rb:1747:in `each'
/Users/Armageddon/.rvm/gems/ruby-1.9.2-p180-patched@acts_as_commentable_with_threading/gems/activerecord-3.1.1/lib/active_record/base.rb:1747:in `assign_attributes'
/Users/Armageddon/.rvm/gems/ruby-1.9.2-p180-patched@acts_as_commentable_with_threading/gems/activerecord-3.1.1/lib/active_record/base.rb:1567:in `initialize'
/Users/Armageddon/.rvm/gems/ruby-1.9.2-p180-patched@acts_as_commentable_with_threading/gems/activerecord-3.1.1/lib/active_record/validations.rb:39:in `new'
/Users/Armageddon/.rvm/gems/ruby-1.9.2-p180-patched@acts_as_commentable_with_threading/gems/activerecord-3.1.1/lib/active_record/validations.rb:39:in `create!'
spec/commentable_spec.rb:17:in `block (4 levels) in <top (required)>'

3)
ActiveRecord::UnknownAttributeError in 'A class that is commentable special class finders#find_comments_by_user should return comments by the passed user'
unknown attribute: commentable
/Users/Armageddon/.rvm/gems/ruby-1.9.2-p180-patched@acts_as_commentable_with_threading/gems/activerecord-3.1.1/lib/active_record/base.rb:1753:in `block in assign_attributes'
/Users/Armageddon/.rvm/gems/ruby-1.9.2-p180-patched@acts_as_commentable_with_threading/gems/activerecord-3.1.1/lib/active_record/base.rb:1747:in `each'
/Users/Armageddon/.rvm/gems/ruby-1.9.2-p180-patched@acts_as_commentable_with_threading/gems/activerecord-3.1.1/lib/active_record/base.rb:1747:in `assign_attributes'
/Users/Armageddon/.rvm/gems/ruby-1.9.2-p180-patched@acts_as_commentable_with_threading/gems/activerecord-3.1.1/lib/active_record/base.rb:1567:in `initialize'
/Users/Armageddon/.rvm/gems/ruby-1.9.2-p180-patched@acts_as_commentable_with_threading/gems/activerecord-3.1.1/lib/active_record/validations.rb:39:in `new'
/Users/Armageddon/.rvm/gems/ruby-1.9.2-p180-patched@acts_as_commentable_with_threading/gems/activerecord-3.1.1/lib/active_record/validations.rb:39:in `create!'
spec/commentable_spec.rb:37:in `block (4 levels) in <top (required)>'

4)
ActiveRecord::UnknownAttributeError in 'A class that is commentable special class finders#find_comments_by_user should not return comments by other users'
unknown attribute: commentable
/Users/Armageddon/.rvm/gems/ruby-1.9.2-p180-patched@acts_as_commentable_with_threading/gems/activerecord-3.1.1/lib/active_record/base.rb:1753:in `block in assign_attributes'
/Users/Armageddon/.rvm/gems/ruby-1.9.2-p180-patched@acts_as_commentable_with_threading/gems/activerecord-3.1.1/lib/active_record/base.rb:1747:in `each'
/Users/Armageddon/.rvm/gems/ruby-1.9.2-p180-patched@acts_as_commentable_with_threading/gems/activerecord-3.1.1/lib/active_record/base.rb:1747:in `assign_attributes'
/Users/Armageddon/.rvm/gems/ruby-1.9.2-p180-patched@acts_as_commentable_with_threading/gems/activerecord-3.1.1/lib/active_record/base.rb:1567:in `initialize'
/Users/Armageddon/.rvm/gems/ruby-1.9.2-p180-patched@acts_as_commentable_with_threading/gems/activerecord-3.1.1/lib/active_record/validations.rb:39:in `new'
/Users/Armageddon/.rvm/gems/ruby-1.9.2-p180-patched@acts_as_commentable_with_threading/gems/activerecord-3.1.1/lib/active_record/validations.rb:39:in `create!'
spec/commentable_spec.rb:37:in `block (4 levels) in <top (required)>'

5)
ActiveRecord::UnknownAttributeError in 'A class that is commentable instance methods#comments_ordered_by_submitted should return its own comments, ordered with the newest first'
unknown attribute: commentable
/Users/Armageddon/.rvm/gems/ruby-1.9.2-p180-patched@acts_as_commentable_with_threading/gems/activerecord-3.1.1/lib/active_record/base.rb:1753:in `block in assign_attributes'
/Users/Armageddon/.rvm/gems/ruby-1.9.2-p180-patched@acts_as_commentable_with_threading/gems/activerecord-3.1.1/lib/active_record/base.rb:1747:in `each'
/Users/Armageddon/.rvm/gems/ruby-1.9.2-p180-patched@acts_as_commentable_with_threading/gems/activerecord-3.1.1/lib/active_record/base.rb:1747:in `assign_attributes'
/Users/Armageddon/.rvm/gems/ruby-1.9.2-p180-patched@acts_as_commentable_with_threading/gems/activerecord-3.1.1/lib/active_record/base.rb:1567:in `initialize'
/Users/Armageddon/.rvm/gems/ruby-1.9.2-p180-patched@acts_as_commentable_with_threading/gems/activerecord-3.1.1/lib/active_record/validations.rb:39:in `new'
/Users/Armageddon/.rvm/gems/ruby-1.9.2-p180-patched@acts_as_commentable_with_threading/gems/activerecord-3.1.1/lib/active_record/validations.rb:39:in `create!'
spec/commentable_spec.rb:61:in `block (4 levels) in <top (required)>'

6)
ActiveRecord::UnknownAttributeError in 'A class that is commentable instance methods#comments_ordered_by_submitted should not include comments for other commentables'
unknown attribute: commentable
/Users/Armageddon/.rvm/gems/ruby-1.9.2-p180-patched@acts_as_commentable_with_threading/gems/activerecord-3.1.1/lib/active_record/base.rb:1753:in `block in assign_attributes'
/Users/Armageddon/.rvm/gems/ruby-1.9.2-p180-patched@acts_as_commentable_with_threading/gems/activerecord-3.1.1/lib/active_record/base.rb:1747:in `each'
/Users/Armageddon/.rvm/gems/ruby-1.9.2-p180-patched@acts_as_commentable_with_threading/gems/activerecord-3.1.1/lib/active_record/base.rb:1747:in `assign_attributes'
/Users/Armageddon/.rvm/gems/ruby-1.9.2-p180-patched@acts_as_commentable_with_threading/gems/activerecord-3.1.1/lib/active_record/base.rb:1567:in `initialize'
/Users/Armageddon/.rvm/gems/ruby-1.9.2-p180-patched@acts_as_commentable_with_threading/gems/activerecord-3.1.1/lib/active_record/validations.rb:39:in `new'
/Users/Armageddon/.rvm/gems/ruby-1.9.2-p180-patched@acts_as_commentable_with_threading/gems/activerecord-3.1.1/lib/active_record/validations.rb:39:in `create!'
spec/commentable_spec.rb:61:in `block (4 levels) in <top (required)>'

Not sure how this happened but there was a missing polymorphic belongs_to in the generator templates. Fixed this in 1.1.2.