Sha256: 4bb8e334d37b14a0af4f8c7c42804ec6a75408dfc78c219738bded8eb1ed1387

Contents?: true

Size: 1.22 KB

Versions: 4

Compression:

Stored size: 1.22 KB

Contents

require "cases/helper"
require 'models/topic'

module ActiveRecord
  module ConnectionAdapters
    class Mysql2Adapter
      class BindParameterTest < ActiveRecord::TestCase
        fixtures :topics

        def test_update_question_marks
          str       = "foo?bar"
          x         = Topic.first
          x.title   = str
          x.content = str
          x.save!
          x.reload
          assert_equal str, x.title
          assert_equal str, x.content
        end

        def test_create_question_marks
          str = "foo?bar"
          x   = Topic.create!(:title => str, :content => str)
          x.reload
          assert_equal str, x.title
          assert_equal str, x.content
        end

        def test_update_null_bytes
          str       = "foo\0bar"
          x         = Topic.first
          x.title   = str
          x.content = str
          x.save!
          x.reload
          assert_equal str, x.title
          assert_equal str, x.content
        end

        def test_create_null_bytes
          str = "foo\0bar"
          x   = Topic.create!(:title => str, :content => str)
          x.reload
          assert_equal str, x.title
          assert_equal str, x.content
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
activejob-lock-0.0.2 rails/activerecord/test/cases/adapters/mysql2/bind_parameter_test.rb
activejob-lock-0.0.1 rails/activerecord/test/cases/adapters/mysql2/bind_parameter_test.rb
activerecord-nuodb-adapter-1.1 test/cases/adapters/mysql2/bind_parameter_test.rb
activerecord-nuodb-adapter-1.0.4 test/cases/adapters/mysql2/bind_parameter_test.rb