From 8572455d4cf7a61462bde7cef2d3724685c1c44c Mon Sep 17 00:00:00 2001 From: Nihad Abbasov Date: Wed, 17 Apr 2013 18:13:29 +0500 Subject: remove extra space before 'ORDER BY' --- test/visitors/test_to_sql.rb | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'test/visitors') diff --git a/test/visitors/test_to_sql.rb b/test/visitors/test_to_sql.rb index 2e3f7f8624..04fca8024b 100644 --- a/test/visitors/test_to_sql.rb +++ b/test/visitors/test_to_sql.rb @@ -181,6 +181,13 @@ module Arel assert_match(/LIMIT 'omg'/, compile(sc)) end + it "should contain a single space before ORDER BY" do + table = Table.new(:users) + test = table.order(table[:name]) + sql = compile test + assert_match(/"users" ORDER BY/, sql) + end + it "should quote LIMIT without column type coercion" do table = Table.new(:users) sc = table.where(table[:name].eq(0)).take(1).ast @@ -291,7 +298,7 @@ module Arel end it "should visit_Arel_Nodes_Assignment" do - column = @table["id"] + column = @table["id"] node = Nodes::Assignment.new( Nodes::UnqualifiedColumn.new(column), Nodes::UnqualifiedColumn.new(column) -- cgit v1.2.3