class Mysql2AnsiQuotesTest

Public Instance Methods

setup() click to toggle source
# File activerecord/test/cases/adapters/mysql2/schema_test.rb, line 110
def setup
  @connection = ActiveRecord::Base.connection
  @connection.execute("SET SESSION sql_mode='ANSI_QUOTES'")
end
teardown() click to toggle source
# File activerecord/test/cases/adapters/mysql2/schema_test.rb, line 115
def teardown
  @connection.reconnect!
end
test_foreign_keys_method_with_ansi_quotes() click to toggle source
# File activerecord/test/cases/adapters/mysql2/schema_test.rb, line 123
def test_foreign_keys_method_with_ansi_quotes
  fks = @connection.foreign_keys("lessons_students")
  assert_equal([["lessons_students", "students", :cascade]],
               fks.map { |fk| [fk.from_table, fk.to_table, fk.on_delete] })
end
test_primary_key_method_with_ansi_quotes() click to toggle source
# File activerecord/test/cases/adapters/mysql2/schema_test.rb, line 119
def test_primary_key_method_with_ansi_quotes
  assert_equal "id", @connection.primary_key("topics")
end