aboutsummaryrefslogtreecommitdiffstats
path: root/spec/arel/engines/sql/unit/predicates
diff options
context:
space:
mode:
Diffstat (limited to 'spec/arel/engines/sql/unit/predicates')
-rw-r--r--spec/arel/engines/sql/unit/predicates/equality_spec.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/spec/arel/engines/sql/unit/predicates/equality_spec.rb b/spec/arel/engines/sql/unit/predicates/equality_spec.rb
index 688a6a20be..e874d07bf3 100644
--- a/spec/arel/engines/sql/unit/predicates/equality_spec.rb
+++ b/spec/arel/engines/sql/unit/predicates/equality_spec.rb
@@ -41,6 +41,21 @@ module Arel
end
end
end
+
+ describe "when relating to a nil Value" do
+ it "manufactures an IS NULL predicate" do
+ value = nil.bind(@relation1)
+ sql = Equality.new(@attribute1, value).to_sql
+
+ adapter_is :mysql do
+ sql.should be_like(%Q{`users`.`id` IS NULL})
+ end
+
+ adapter_is_not :mysql do
+ sql.should be_like(%Q{"users"."id" IS NULL})
+ end
+ end
+ end
end
end
end