1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/spec/arel/visitors/to_sql_spec.rb

27 lines
628 B
Ruby
Raw Normal View History

2010-08-13 21:55:15 -04:00
require 'spec_helper'
module Arel
module Visitors
describe 'the to_sql visitor' do
before do
@visitor = ToSql.new Table.engine
@attr = Table.new(:users)[:id]
end
it "should visit visit_Arel_Attributes_Time" do
attr = Attributes::Time.new(@attr.relation, @attr.name, @attr.column)
@visitor.accept attr
end
describe 'Equality' do
it "should escape strings" do
test = @attr.eq 'Aaron Patterson'
@visitor.accept(test).should be_like %{
"users"."id" = 'Aaron Patterson'
}
end
end
2010-08-13 21:55:15 -04:00
end
end
end