mirror of
https://github.com/github/rails.git
synced 2026-02-10 22:25:02 -05:00
* TestCase: introduce declared setup and teardown callbacks. Pass a list of methods and an optional block to call before setup or after teardown. Setup callbacks are run in the order declared; teardown callbacks are run in reverse. [Jeremy Kemper] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8570 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
18 lines
442 B
Ruby
18 lines
442 B
Ruby
require 'abstract_unit'
|
|
require 'fixtures/topic'
|
|
|
|
class TestColumnAlias < ActiveSupport::TestCase
|
|
fixtures :topics
|
|
|
|
QUERY = if 'Oracle' == ActiveRecord::Base.connection.adapter_name
|
|
'SELECT id AS pk FROM topics WHERE ROWNUM < 2'
|
|
else
|
|
'SELECT id AS pk FROM topics'
|
|
end
|
|
|
|
def test_column_alias
|
|
records = Topic.connection.select_all(QUERY)
|
|
assert_equal 'pk', records[0].keys[0]
|
|
end
|
|
end
|