Sha256: 54d812f7726a4a0ef134964b7987bb7f7d838beb94d9f4d660b2ee472f44d9c3

Contents?: true

Size: 893 Bytes

Versions: 3

Compression:

Stored size: 893 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|
        config.must_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 = lambda { |user| 'Some name' }
      proc2 = lambda { |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

3 entries across 3 versions & 1 rubygems

Version Path
commontator-5.1.0 spec/lib/commontator/commontator_config_spec.rb~
commontator-4.11.0 spec/lib/commontator/commontator_config_spec.rb~
commontator-4.10.4 spec/lib/commontator/commontator_config_spec.rb~