Sha256: 32221c379a8306f32d135b4fc2361dbf18598babcf371f514cb8d2cff8051dcc
Contents?: true
Size: 654 Bytes
Versions: 9
Compression:
Stored size: 654 Bytes
Contents
require 'spec_helper' module Arel describe Expression do before do @relation = Table.new(:users) @attribute = @relation[:id] end describe '#to_sql' do it "manufactures sql with the expression and alias" do sql = Count.new(@attribute, :alias).to_sql adapter_is :mysql do sql.should be_like(%Q{COUNT(`users`.`id`) AS `alias`}) end adapter_is :oracle do sql.should be_like(%Q{COUNT("USERS"."ID") AS "ALIAS"}) end adapter_is_not :mysql, :oracle do sql.should be_like(%Q{COUNT("users"."id") AS "alias"}) end end end end end
Version data entries
9 entries across 9 versions & 2 rubygems