Sha256: abdf7c1b8b955c01bb81ce35925cfb554a7f2c298fa5682cedb423e2b859a7c4

Contents?: true

Size: 551 Bytes

Versions: 5

Compression:

Stored size: 551 Bytes

Contents

# frozen_string_literal: true

require "cases/helper"

module ActiveRecord
  class StringTypeTest < ActiveRecord::TestCase
    test "string mutations are detected" do
      klass = Class.new(Base)
      klass.table_name = "authors"

      author = klass.create!(name: "Sean")
      assert_not_predicate author, :changed?

      author.name << " Griffin"
      assert_predicate author, :name_changed?

      author.save!
      author.reload

      assert_equal "Sean Griffin", author.name
      assert_not_predicate author, :changed?
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
ibm_db-5.5.0 test/cases/type/string_test.rb
ibm_db-5.4.1 test/cases/type/string_test.rb
ibm_db-5.4.0 test/cases/type/string_test.rb
ibm_db-5.3.2 test/cases/type/string_test.rb
ibm_db-5.3.1 test/cases/type/string_test.rb