Sha256: fd98cd3a74b933792bf3da4760a4e55f6005e8f9c08b542d83d4f520ded16fb1
Contents?: true
Size: 537 Bytes
Versions: 4
Compression:
Stored size: 537 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_not :mysql do sql.should be_like(%Q{COUNT("users"."id") AS "alias"}) end end end end end
Version data entries
4 entries across 4 versions & 1 rubygems