aboutsummaryrefslogtreecommitdiffstats
path: root/test/test_select_manager.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/test_select_manager.rb')
-rw-r--r--test/test_select_manager.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/test_select_manager.rb b/test/test_select_manager.rb
index e948aec131..119ad3ec4f 100644
--- a/test/test_select_manager.rb
+++ b/test/test_select_manager.rb
@@ -412,6 +412,15 @@ module Arel
ast = mgr.ast
mgr.visitor.accept(ast).must_equal mgr.to_sql
end
+ it 'should allow orders to work when the ast is grepped' do
+ table = Table.new :users
+ mgr = table.from table
+ mgr.project Arel.sql '*'
+ mgr.from table
+ mgr.orders << Arel::Nodes::Ascending.new(Arel.sql('foo'))
+ mgr.ast.grep(Arel::Nodes::OuterJoin)
+ mgr.to_sql.must_be_like %{ SELECT * FROM "users" ORDER BY foo ASC }
+ end
end
describe 'taken' do