aboutsummaryrefslogtreecommitdiffstats
path: root/spec/relations/table_relation_spec.rb
blob: dec8bba6b1c611259721233a2b62e26509a34bb7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
require File.join(File.dirname(__FILE__), '..', 'spec_helper')

describe TableRelation do
  describe '#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
  
  describe '#attributes' do
    it 'manufactures attributes corresponding to columns in the table' do
      pending
    end
  end
end