Created
December 27, 2009 19:25
-
-
Save miloops/264373 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'spec_helper' | |
module Arel | |
describe Table do | |
before do | |
@relation = Table.new(:users) | |
end | |
describe '#to_sql' do | |
it "manufactures a simple select query" do | |
sql = @relation.from("workers").to_sql | |
adapter_is :mysql do | |
sql.should be_like(%Q{ | |
SELECT `users`.`id`, `users`.`name` | |
FROM workers | |
}) | |
end | |
adapter_is_not :mysql do | |
sql.should be_like(%Q{ | |
SELECT "users"."id", "users"."name" | |
FROM workers | |
}) | |
end | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment