Methods
N
S
T
Class Public methods
name()
# File activerecord/test/cases/adapters/mysql/schema_test.rb, line 18
def self.name; 'Post'; end
Instance Public methods
setup()
# File activerecord/test/cases/adapters/mysql/schema_test.rb, line 10
def setup
  @connection = ActiveRecord::Base.connection
  db          = Post.connection_pool.spec.config[:database]
  table       = Post.table_name
  @db_name    = db

  @omgpost = Class.new(ActiveRecord::Base) do
    self.table_name = "#{db}.#{table}"
    def self.name; 'Post'; end
  end
end
test_primary_key()
# File activerecord/test/cases/adapters/mysql/schema_test.rb, line 26
def test_primary_key
  assert_equal 'id', @omgpost.primary_key
end
test_schema()
# File activerecord/test/cases/adapters/mysql/schema_test.rb, line 22
def test_schema
  assert @omgpost.find(:first)
end
test_table_exists?()
# File activerecord/test/cases/adapters/mysql/schema_test.rb, line 30
def test_table_exists?
  name = @omgpost.table_name
  assert @connection.table_exists?(name), "#{name} table should exist"
end
test_table_exists_wrong_schema()
# File activerecord/test/cases/adapters/mysql/schema_test.rb, line 35
def test_table_exists_wrong_schema
  assert(!@connection.table_exists?("#{@db_name}.zomg"), "table should not exist")
end