aboutsummaryrefslogtreecommitdiffstats
path: root/spec/arel
diff options
context:
space:
mode:
Diffstat (limited to 'spec/arel')
-rw-r--r--spec/arel/attributes/attribute_spec.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/spec/arel/attributes/attribute_spec.rb b/spec/arel/attributes/attribute_spec.rb
index fb6954dc7e..ee12aa2371 100644
--- a/spec/arel/attributes/attribute_spec.rb
+++ b/spec/arel/attributes/attribute_spec.rb
@@ -3,6 +3,22 @@ require 'spec_helper'
module Arel
module Attributes
describe 'attribute' do
+ describe '#gteq' do
+ it 'should create a GreaterThanOrEqual node' do
+ relation = Table.new(:users)
+ relation[:id].gteq(10).should be_kind_of Nodes::GreaterThanOrEqual
+ end
+
+ it 'should generate >= in sql' do
+ relation = Table.new(:users)
+ mgr = relation.project relation[:id]
+ mgr.where relation[:id].gteq(10)
+ mgr.to_sql.should be_like %{
+ SELECT "users"."id" FROM "users" WHERE "users"."id" >= 10
+ }
+ end
+ end
+
describe '#average' do
it 'should create a AVG node' do
relation = Table.new(:users)