|
Revision 3718, 439 bytes
(checked in by david, 3 years ago)
|
Renamed the "oci" adapter to "oracle", but kept the old name as an alias (closes #4017) [schoenm@earthlink.net]
|
| Line | |
|---|
| 1 |
require 'abstract_unit' |
|---|
| 2 |
require 'fixtures/topic' |
|---|
| 3 |
|
|---|
| 4 |
class TestColumnAlias < Test::Unit::TestCase |
|---|
| 5 |
fixtures :topics |
|---|
| 6 |
|
|---|
| 7 |
QUERY = if 'Oracle' == ActiveRecord::Base.connection.adapter_name |
|---|
| 8 |
'SELECT id AS pk FROM topics WHERE ROWNUM < 2' |
|---|
| 9 |
else |
|---|
| 10 |
'SELECT id AS pk FROM topics' |
|---|
| 11 |
end |
|---|
| 12 |
|
|---|
| 13 |
def test_column_alias |
|---|
| 14 |
records = Topic.connection.select_all(QUERY) |
|---|
| 15 |
assert_equal 'pk', records[0].keys[0] |
|---|
| 16 |
end |
|---|
| 17 |
end |
|---|