aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test
diff options
context:
space:
mode:
Diffstat (limited to 'activerecord/test')
-rw-r--r--activerecord/test/column_alias_test.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/activerecord/test/column_alias_test.rb b/activerecord/test/column_alias_test.rb
new file mode 100644
index 0000000000..06a0a7f3b0
--- /dev/null
+++ b/activerecord/test/column_alias_test.rb
@@ -0,0 +1,12 @@
+require 'abstract_unit'
+require 'fixtures/topic'
+
+class TestColumnAlias < Test::Unit::TestCase
+
+ def test_column_alias
+ topic = Topic.find(1)
+ records = topic.connection.select_all("SELECT id AS pk FROM topics LIMIT 1")
+ assert_equal(records[0].keys[0], "pk")
+ end
+
+end