aboutsummaryrefslogtreecommitdiffstats
path: root/spec
diff options
context:
space:
mode:
Diffstat (limited to 'spec')
-rw-r--r--spec/arel/engines/sql/unit/predicates/equality_spec.rb15
-rw-r--r--spec/connections/mysql_connection.rb2
2 files changed, 16 insertions, 1 deletions
diff --git a/spec/arel/engines/sql/unit/predicates/equality_spec.rb b/spec/arel/engines/sql/unit/predicates/equality_spec.rb
index 3588604062..c4dd2c0c31 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
diff --git a/spec/connections/mysql_connection.rb b/spec/connections/mysql_connection.rb
index dbece8646f..66a53b5037 100644
--- a/spec/connections/mysql_connection.rb
+++ b/spec/connections/mysql_connection.rb
@@ -7,7 +7,7 @@ ActiveRecord::Base.logger = Logger.new("debug.log")
ActiveRecord::Base.configurations = {
'unit' => {
:adapter => 'mysql',
- :username => 'rails',
+ :username => 'root',
:encoding => 'utf8',
:database => 'arel_unit',
}