Sha256: aac9999eca94638c7ee2715dbeb456b53cb5b60e40c0c0cfa7f03844aadc3037

Contents?: true

Size: 750 Bytes

Versions: 21

Compression:

Stored size: 750 Bytes

Contents

# Copyright 2020 Google LLC
#
# Use of this source code is governed by an MIT-style
# license that can be found in the LICENSE file or at
# https://opensource.org/licenses/MIT.

# frozen_string_literal: true

require "test_helper"

module ActiveRecord
  module Type
    class TextTest < SpannerAdapter::TestCase
      include SpannerAdapter::Types::TestHelper

      def test_convert_to_sql_type
        assert_equal "STRING(MAX)", connection.type_to_sql(:text)
        assert_equal "STRING(1024)", connection.type_to_sql(:text, limit: 1024)
      end

      def test_set_text_in_create
        text = "a" * 1000
        record = TestTypeModel.create(bio: text)
        record.reload

        assert_equal text, record.bio
      end
    end
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
activerecord-spanner-adapter-1.6.3 acceptance/cases/type/text_test.rb
activerecord-spanner-adapter-1.6.2 acceptance/cases/type/text_test.rb
activerecord-spanner-adapter-1.6.1 acceptance/cases/type/text_test.rb
activerecord-spanner-adapter-1.6.0 acceptance/cases/type/text_test.rb
activerecord-spanner-adapter-1.5.1 acceptance/cases/type/text_test.rb
activerecord-spanner-adapter-1.5.0 acceptance/cases/type/text_test.rb
activerecord-spanner-adapter-1.4.4 acceptance/cases/type/text_test.rb
activerecord-spanner-adapter-1.4.3 acceptance/cases/type/text_test.rb
activerecord-spanner-adapter-1.4.2 acceptance/cases/type/text_test.rb
activerecord-spanner-adapter-1.4.1 acceptance/cases/type/text_test.rb
activerecord-spanner-adapter-1.4.0 acceptance/cases/type/text_test.rb
activerecord-spanner-adapter-1.3.1 acceptance/cases/type/text_test.rb
activerecord-spanner-adapter-1.2.2 acceptance/cases/type/text_test.rb
activerecord-spanner-adapter-1.2.1 acceptance/cases/type/text_test.rb
activerecord-spanner-adapter-1.2.0 acceptance/cases/type/text_test.rb
activerecord-spanner-adapter-1.1.0 acceptance/cases/type/text_test.rb
activerecord-spanner-adapter-1.0.1 acceptance/cases/type/text_test.rb
activerecord-spanner-adapter-1.0.0 acceptance/cases/type/text_test.rb
activerecord-spanner-adapter-0.7.0 acceptance/cases/type/text_test.rb
activerecord-spanner-adapter-0.6.0 acceptance/cases/type/text_test.rb