Sha256: a84498ac2b84d7009854bfae3982778719a511c0ed8ef4737a87a80aaab4cc4f

Contents?: true

Size: 915 Bytes

Versions: 2

Compression:

Stored size: 915 Bytes

Contents

require 'rails_helper'

module Commontator
  RSpec.describe CommontableConfig, type: :lib do
    it 'must respond to commontable attributes' do
      config = CommontableConfig.new
      COMMONTABLE_ATTRIBUTES.each do |attribute|
        expect(config).to respond_to(attribute)
      end
    end

    it "won't respond to engine or commontator attributes" do
      config = CommontableConfig.new
      (ENGINE_ATTRIBUTES + COMMONTATOR_ATTRIBUTES).each do |attribute|
        expect(config).not_to respond_to(attribute)
      end
    end

    it 'must be configurable' do
      proc = ->(thread) { 'Some name' }
      proc2 = ->(thread) { 'Another name' }
      config = CommontableConfig.new(commontable_name_proc: proc)
      expect(config.commontable_name_proc).to eq proc
      config = CommontableConfig.new(commontable_name_proc: proc2)
      expect(config.commontable_name_proc).to eq proc2
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
commontator-5.1.0 spec/lib/commontator/commontable_config_spec.rb
commontator-5.0.0 spec/lib/commontator/commontable_config_spec.rb