Sha256: 3d509988b6567aaa7d7e01bb8f84af474716ef2d511892772479b3db7df629ad
Contents?: true
Size: 865 Bytes
Versions: 1
Compression:
Stored size: 865 Bytes
Contents
require "spec_helper" require_dependency "on/destroy" module On RSpec.describe Destroy, type: :model, versioning: true do describe "#versions" do it "only creates one version record, for the destroy event" do record = described_class.create(name: "Alice") record.update_attributes(name: "blah") record.destroy expect(record.versions.length).to(eq(1)) expect(record.versions.last.event).to(eq("destroy")) end end context "#paper_trail_event" do it "rembembers the custom event name" do record = described_class.create(name: "Alice") record.paper_trail_event = "banana" record.update_attributes(name: "blah") record.destroy expect(record.versions.length).to(eq(1)) expect(record.versions.last.event).to(eq("banana")) end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
paper_trail-7.1.0 | spec/models/on/destroy_spec.rb |