aboutsummaryrefslogtreecommitdiffstats
path: root/spec/relations/table_relation_spec.rb
blob: 8cd31a9ac829c2b18a39319b518af012aa52aaf7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
require File.join(File.dirname(__FILE__), '..', 'spec_helper')

describe TableRelation, '#to_sql' do
  it "returns a simple SELECT query" do
    TableRelation.new(:users).to_sql.should == SelectBuilder.new do |s|
      select do
        column :users, :name
        column :users, :id
      end
      from :users
    end
  end
end