paper-trail-gem--paper_trail/spec/models/document_spec.rb

22 lines
651 B
Ruby
Raw Normal View History

require "spec_helper"
RSpec.describe Document, type: :model do
describe "`have_a_version_with` matcher", versioning: true do
it "works with custom versions association" do
document = Document.create!(name: "Foo")
document.update_attributes!(name: "Bar")
expect(document).to have_a_version_with(name: "Foo")
end
end
describe "`have_a_version_with_changes` matcher", versioning: true do
it "works with custom versions association" do
document = Document.create!(name: "Foo")
document.update_attributes!(name: "Bar")
expect(document).to have_a_version_with_changes(name: "Bar")
end
end
end