Sha256: 0e932f5c7272d35d21ccfd12ca7836aef180b0faa929269615b9c5f7bbaa496e

Contents?: true

Size: 628 Bytes

Versions: 4

Compression:

Stored size: 628 Bytes

Contents

require "rails_helper"

describe NotOnUpdate, type: :model do
  describe "#touch_with_version", versioning: true do
    let!(:record) { described_class.create! }

    it "creates a version, regardless" do
      expect { record.paper_trail.touch_with_version }.to change {
        PaperTrail::Version.count
      }.by(+1)
    end

    it "increments the `:updated_at` timestamp" do
      before = record.updated_at
      # Travel 1 second because MySQL lacks sub-second resolution
      Timecop.travel(1) do
        record.paper_trail.touch_with_version
      end
      expect(record.updated_at).to be > before
    end
  end
end

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
enju_leaf-1.2.1 vendor/bundle/ruby/2.3/gems/paper_trail-7.0.2/spec/models/not_on_update_spec.rb
paper_trail-7.0.2 spec/models/not_on_update_spec.rb
paper_trail-7.0.1 spec/models/not_on_update_spec.rb
paper_trail-7.0.0 spec/models/not_on_update_spec.rb