mirror of
https://github.com/paper-trail-gem/paper_trail.git
synced 2022-11-09 11:33:19 -05:00
e36ba138a3
[Fixes #740]
33 lines
861 B
Ruby
33 lines
861 B
Ruby
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
|