diff options
Diffstat (limited to 'spec/arel/unit/primitives/expression_spec.rb')
-rw-r--r-- | spec/arel/unit/primitives/expression_spec.rb | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/spec/arel/unit/primitives/expression_spec.rb b/spec/arel/unit/primitives/expression_spec.rb index 4943f4ef33..ebde55ff90 100644 --- a/spec/arel/unit/primitives/expression_spec.rb +++ b/spec/arel/unit/primitives/expression_spec.rb @@ -38,7 +38,15 @@ module Arel describe '#to_sql' do it "manufactures sql with the expression and alias" do - Expression.new(@attribute, "COUNT", :alias).to_sql.should == "COUNT(`users`.`id`) AS `alias`" + sql = Expression.new(@attribute, "COUNT", :alias).to_sql + + adapter_is :mysql do + sql.should be_like(%Q{COUNT(`users`.`id`) AS `alias`}) + end + + adapter_is_not :mysql do + sql.should be_like(%Q{COUNT("users"."id") AS "alias"}) + end end end end |