2016-03-05 17:07:32 -05:00
|
|
|
require "rails_helper"
|
2015-02-26 23:37:16 -05:00
|
|
|
|
2016-02-15 22:32:40 -05:00
|
|
|
describe PaperTrail, type: :module, versioning: true do
|
2016-06-27 03:02:33 -04:00
|
|
|
describe "#config" do
|
2015-02-26 23:37:16 -05:00
|
|
|
it { is_expected.to respond_to(:config) }
|
|
|
|
|
|
|
|
it "should allow for config values to be set" do
|
|
|
|
expect(subject.config.enabled).to eq(true)
|
|
|
|
subject.config.enabled = false
|
|
|
|
expect(subject.config.enabled).to eq(false)
|
|
|
|
end
|
|
|
|
|
|
|
|
it "should accept blocks and yield the config instance" do
|
|
|
|
expect(subject.config.enabled).to eq(true)
|
|
|
|
subject.config { |c| c.enabled = false }
|
|
|
|
expect(subject.config.enabled).to eq(false)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2016-06-27 03:02:33 -04:00
|
|
|
describe "#configure" do
|
2015-02-26 23:37:16 -05:00
|
|
|
it { is_expected.to respond_to(:configure) }
|
|
|
|
|
|
|
|
it "should be an alias for the `config` method" do
|
|
|
|
expect(subject.method(:configure)).to eq(subject.method(:config))
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|