elight/acts_as_commentable_with_threading — Issue #20: How to get commendable tests to run on it's own in Gem?
Author: dfischer
Created: 2011-10-21 11:41:29+00:00
State: open

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 '

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 '

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 '

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 '

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 '

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 '
```