Sha256: 8ea3b6d1d6efcc762a3021b79ffdb6d27691e6c87f2cd18d2f3e86d8d93cf61b

Contents?: true

Size: 506 Bytes

Versions: 6

Compression:

Stored size: 506 Bytes

Contents

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 author.changed?

      author.name << ' Griffin'
      assert author.name_changed?

      author.save!
      author.reload

      assert_equal 'Sean Griffin', author.name
      assert_not author.changed?
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
ibm_db-5.2.0-x86-mingw32 test/cases/type/string_test.rb
ibm_db-5.1.0-x86-mingw32 test/cases/type/string_test.rb
ibm_db-5.0.5-x86-mingw32 test/cases/type/string_test.rb
ibm_db-5.0.4-x86-mingw32 test/cases/type/string_test.rb
ibm_db-5.0.3-x86-mingw32 test/cases/type/string_test.rb
ibm_db-5.0.2-x86-mingw32 test/cases/type/string_test.rb