Sha256: 25e7fbd53fbecd691ed0dabb418758ede20b199cb7dc62fdedc0c01fd4be2354

Contents?: true

Size: 962 Bytes

Versions: 9

Compression:

Stored size: 962 Bytes

Contents

require 'test_helper'

module Commontator
  describe ActsAsCommontable do
    it 'must add methods to ActiveRecord and subclasses' do
      ActiveRecord::Base.must_respond_to :acts_as_commontable
      ActiveRecord::Base.must_respond_to :is_commontable
      ActiveRecord::Base.is_commontable.must_equal false
      DummyModel.must_respond_to :acts_as_commontable
      DummyModel.must_respond_to :is_commontable
      DummyModel.is_commontable.must_equal true
      DummyUser.must_respond_to :acts_as_commontable
      DummyUser.must_respond_to :is_commontable
      DummyUser.is_commontable.must_equal false
    end
    
    it 'must modify models that act_as_commontable' do
      dummy = DummyModel.create
      dummy.must_respond_to :thread
      dummy.must_respond_to :comments
      dummy.must_respond_to :subscriptions
      dummy.must_respond_to :commontable_config
      dummy.commontable_config.must_be_instance_of CommontableConfig
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
commontator-4.3.0 spec/lib/commontator/acts_as_commontable_spec.rb
commontator-4.2.2 spec/lib/commontator/acts_as_commontable_spec.rb
commontator-4.2.1 spec/lib/commontator/acts_as_commontable_spec.rb
commontator-4.2.0 spec/lib/commontator/acts_as_commontable_spec.rb
commontator-4.1.2 spec/lib/commontator/acts_as_commontable_spec.rb
commontator-4.1.1 spec/lib/commontator/acts_as_commontable_spec.rb
commontator-4.0.2 spec/lib/commontator/acts_as_commontable_spec.rb
commontator-4.0.1 spec/lib/commontator/acts_as_commontable_spec.rb
commontator-4.0.0 spec/lib/commontator/acts_as_commontable_spec.rb