1
0
Fork 0
mirror of https://github.com/paper-trail-gem/paper_trail.git synced 2022-11-09 11:33:19 -05:00
paper-trail-gem--paper_trail/spec/paper_trail/compatibility_spec.rb
David Furber c10a8573f1
Rails 7.0 Compatibility (#1365)
* Make paper_trail work with Rails 7.0

* from class_methods do back to module ClassMethods

* add spec for PostgresArraySerializer to boost coverage

* lint the spec for PostgresArraySerializer

* lint the spec for PostgresArraySerializer again

* and now make that linted spec pass again

* test object change scopes a bit

* round out json and jsonb testing of object scopes

* test some other code paths to increase coverage

* linting

* linting

* mess with yaml loading in test

* oddball cop for double quotes

* use Rails public API for compatibility rather than instance_variable_set

Co-authored-by: dfurber <dfurber@truecar.com>
2022-01-21 00:10:53 -05:00

25 lines
686 B
Ruby

# frozen_string_literal: true
module PaperTrail
::RSpec.describe(Compatibility) do
describe ".check_activerecord" do
context "when compatible" do
it "does not produce output" do
ar_version = ::Gem::Version.new("6.0.0")
expect {
described_class.check_activerecord(ar_version)
}.not_to output.to_stderr
end
end
context "when incompatible" do
it "writes a warning to stderr" do
ar_version = ::Gem::Version.new("7.1.0")
expect {
described_class.check_activerecord(ar_version)
}.to output(/not compatible/).to_stderr
end
end
end
end
end