Sha256: 3a1155163af3f4fc89cfaf3b4e773b3e2b7d5e6b52f5a7f3d2c2e64827a40e6b
Contents?: true
Size: 962 Bytes
Versions: 3
Compression:
Stored size: 962 Bytes
Contents
require 'rails_helper' module Commontator RSpec.describe ActsAsCommontable, type: :lib do it 'must add methods to ActiveRecord and subclasses' do expect(ActiveRecord::Base).to respond_to(:acts_as_commontable) expect(ActiveRecord::Base).to respond_to(:is_commontable) expect(ActiveRecord::Base.is_commontable).to eq false expect(DummyModel).to respond_to(:acts_as_commontable) expect(DummyModel).to respond_to(:is_commontable) expect(DummyModel.is_commontable).to eq true expect(DummyUser).to respond_to(:acts_as_commontable) expect(DummyUser).to respond_to(:is_commontable) expect(DummyUser.is_commontable).to eq false end it 'must modify models that act_as_commontable' do dummy = DummyModel.create expect(dummy).to respond_to(:thread) expect(dummy).to respond_to(:commontable_config) dummy.commontable_config.must_be_instance_of CommontableConfig end end end
Version data entries
3 entries across 3 versions & 1 rubygems