Sha256: 3afd7c39280dc04edf0fed7d535dd609706d7164dd718ea4901a52e193dfda17

Contents?: true

Size: 883 Bytes

Versions: 2

Compression:

Stored size: 883 Bytes

Contents

require 'rails_helper'

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

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

    it 'must be configurable' do
      proc = ->(user) { 'Some name' }
      proc2 = ->(user) { 'Another name' }
      config = CommontatorConfig.new(user_name_proc: proc)
      expect(config.user_name_proc).to eq proc
      config = CommontatorConfig.new(user_name_proc: proc2)
      expect(config.user_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/commontator_config_spec.rb
commontator-5.0.0 spec/lib/commontator/commontator_config_spec.rb