I use audited gem to audit all changes on my models. In gem specification (https://www.rubydoc.info/github/collectiveidea/audited/Audited/RspecMatchers) we can find info how to test it with use of RSpec, i.e:
it { should be_audited }
it { should be_audited.associated_with(:user) }
I would like to do similar tests but without RSpec - any suggestions how to do it?
You can check if it
respond_to?certain methods that come along with audited gem. likeAlso you could use
auditing_enabledoption from the readme.This returns in default true when audited is there.
The same for associated audits. Just build a data structure for you relation and check of the audits are equal your expected results. Take this example from the audited readme for example:
There you can then easily check if the associated audits look like you want it.