aboutsummaryrefslogtreecommitdiffstats
path: root/spec/engines
diff options
context:
space:
mode:
Diffstat (limited to 'spec/engines')
-rw-r--r--spec/engines/sql/unit/relations/take_spec.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/spec/engines/sql/unit/relations/take_spec.rb b/spec/engines/sql/unit/relations/take_spec.rb
index 9f2967a0bd..cc3c3dbbf5 100644
--- a/spec/engines/sql/unit/relations/take_spec.rb
+++ b/spec/engines/sql/unit/relations/take_spec.rb
@@ -34,6 +34,14 @@ module Arel
ORDER BY "USERS"."ID" ASC)
where rownum <= 4
})
+
+ sql_with_distinct = Take.new(@relation.project('DISTINCT "USERS"."ID"'), @taken).to_sql
+ sql_with_distinct.should be_like(%Q{
+ select * from
+ (SELECT DISTINCT "USERS"."ID"
+ FROM "USERS")
+ where rownum <= 4
+ })
end
adapter_is_not :mysql, :oracle do