aboutsummaryrefslogtreecommitdiffstats
path: root/test/nodes/test_table_alias.rb
diff options
context:
space:
mode:
authorJon Leighton <j@jonathanleighton.com>2012-07-13 11:19:17 +0100
committerJon Leighton <j@jonathanleighton.com>2012-07-13 11:19:17 +0100
commit1de1041c00abff9cfc57837a80e12157901ff194 (patch)
tree4012d27d584a7b93f8e41e9ade373b1de9551887 /test/nodes/test_table_alias.rb
parentb5432046134e8c8aa8cafa5960b387b4befff889 (diff)
downloadrails-1de1041c00abff9cfc57837a80e12157901ff194.tar.gz
rails-1de1041c00abff9cfc57837a80e12157901ff194.tar.bz2
rails-1de1041c00abff9cfc57837a80e12157901ff194.zip
Add Nodes::TableAlias#engine
Eventually #engine should go away, but until that time, this means that Table and Nodes::TableAlias can be used more interchangeably.
Diffstat (limited to 'test/nodes/test_table_alias.rb')
-rw-r--r--test/nodes/test_table_alias.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/nodes/test_table_alias.rb b/test/nodes/test_table_alias.rb
new file mode 100644
index 0000000000..fef24bb19e
--- /dev/null
+++ b/test/nodes/test_table_alias.rb
@@ -0,0 +1,16 @@
+require 'helper'
+require 'ostruct'
+
+module Arel
+ module Nodes
+ describe 'table alias' do
+ it 'has an #engine which delegates to the relation' do
+ engine = Object.new
+ relation = OpenStruct.new(:engine => engine)
+
+ node = TableAlias.new relation, :foo
+ node.engine.must_equal engine
+ end
+ end
+ end
+end