<commit_before># frozen_string_literal: true

require "cases/helper"
require "models/invoice"
require "models/line_item"
require "models/topic"
require "models/node"
require "models/tree"

class TouchLaterTest < ActiveRecord::TestCase
  fixtures :nodes, :trees

  def test_touch_laster_raise_if_non_persisted
    invoice = Invoice.new
    Invoice.transaction do
      assert_not_predicate invoice, :persisted?
      assert_raises(ActiveRecord::ActiveRecordError) do
        invoice.touch_later
      end
    end
  end

  def test_touch_later_dont_set_dirty_attributes
    invoice = Invoice.create!
    invoice.touch_later<commit_msg>Fix typo for touch later test description. laster -> later<commit_after># frozen_string_literal: true

require "cases/helper"
require "models/invoice"
require "models/line_item"
require "models/topic"
require "models/node"
require "models/tree"

class TouchLaterTest < ActiveRecord::TestCase
  fixtures :nodes, :trees

  def test_touch_later_raise_if_non_persisted
    invoice = Invoice.new
    Invoice.transaction do
      assert_not_predicate invoice, :persisted?
      assert_raises(ActiveRecord::ActiveRecordError) do
        invoice.touch_later
      end
    end
  end

  def test_touch_later_dont_set_dirty_attributes
    invoice = Invoice.create!
    invoice.touch_later
{'fraction_non_alphanumeric': 0.06946564885496183, 'fraction_numerical': 0.0, 'mean_word_length': 4.555084745762712, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6260442', 'n_tokens_mistral': 423, 'n_tokens_neox': 401, 'n_words': 89}