aboutsummaryrefslogtreecommitdiffstats
path: root/spec/visitors
diff options
context:
space:
mode:
authorErnie Miller <ernie@metautonomo.us>2010-09-29 20:08:57 -0400
committerErnie Miller <ernie@metautonomo.us>2010-09-29 20:08:57 -0400
commiteef61ab909b614ce6f2d100cfb50044c063bc24a (patch)
treeeaa50f239fab9b1b3ed88be89ba743b5724fb19a /spec/visitors
parentf5b76c220ed6583628a84fd899fbb24c39c997ee (diff)
downloadrails-eef61ab909b614ce6f2d100cfb50044c063bc24a.tar.gz
rails-eef61ab909b614ce6f2d100cfb50044c063bc24a.tar.bz2
rails-eef61ab909b614ce6f2d100cfb50044c063bc24a.zip
Support Attribute#asc and Attribute#desc to create orderings
Diffstat (limited to 'spec/visitors')
-rw-r--r--spec/visitors/to_sql_spec.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/spec/visitors/to_sql_spec.rb b/spec/visitors/to_sql_spec.rb
index 1302d73e1c..a2862e4c4f 100644
--- a/spec/visitors/to_sql_spec.rb
+++ b/spec/visitors/to_sql_spec.rb
@@ -66,6 +66,15 @@ module Arel
@visitor.accept(test).should be_like %{ "users"."id" = 't' }
end
+ describe "Nodes::Ordering" do
+ it "should know how to visit" do
+ node = @attr.desc
+ @visitor.accept(node).should be_like %{
+ "users"."id" DESC
+ }
+ end
+ end
+
describe "Nodes::In" do
it "should know how to visit" do
node = @attr.in [1, 2, 3]