Sha256: 56e340ef0326217bd3a8b27b5201d4981a03e07fab2c8017f202a6b456e83341

Contents?: true

Size: 861 Bytes

Versions: 12

Compression:

Stored size: 861 Bytes

Contents

require "rails_helper"

module PaperTrail
  RSpec.describe Config do
    describe ".instance" do
      it "returns the singleton instance" do
        expect { described_class.instance }.to_not raise_error
      end
    end

    describe ".new" do
      it "raises NoMethodError" do
        expect { described_class.new }.to raise_error(NoMethodError)
      end
    end

    describe "track_associations?" do
      context "@track_associations is nil" do
        after do
          PaperTrail.config.track_associations = true
        end

        it "returns false and prints a deprecation warning" do
          config = described_class.instance
          config.track_associations = nil
          expect {
            expect(config.track_associations?).to eq(false)
          }.to output(/DEPRECATION WARNING/).to_stderr
        end
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 2 rubygems

Version Path
enju_leaf-1.2.1 vendor/bundle/ruby/2.3/gems/paper_trail-5.2.3/spec/paper_trail/config_spec.rb
paper_trail-6.0.2 spec/paper_trail/config_spec.rb
paper_trail-6.0.1 spec/paper_trail/config_spec.rb
paper_trail-6.0.0 spec/paper_trail/config_spec.rb
paper_trail-5.2.3 spec/paper_trail/config_spec.rb
paper_trail-5.2.2 spec/paper_trail/config_spec.rb
paper_trail-5.2.1 spec/paper_trail/config_spec.rb
paper_trail-5.2.0 spec/paper_trail/config_spec.rb
paper_trail-5.1.1 spec/paper_trail/config_spec.rb
paper_trail-5.1.0 spec/paper_trail/config_spec.rb
paper_trail-5.0.1 spec/paper_trail/config_spec.rb
paper_trail-5.0.0 spec/paper_trail/config_spec.rb