Sha256: 8330d00d2dd81dc7a2fbda0bcb47292b08c8bed7e2b428896026f4a5a9b72de2

Contents?: true

Size: 484 Bytes

Versions: 8

Compression:

Stored size: 484 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

8 entries across 8 versions & 1 rubygems

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