aboutsummaryrefslogtreecommitdiffstats
path: root/spec/arel/insert_manager.rb
blob: 8d49556fa99522e94c3c5800d660fba3c306cc32 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
require 'spec_helper'

module Arel
  describe 'insert manager' do
    describe 'new' do
      it 'takes an engine' do
        Arel::InsertManager.new Table.engine
      end
    end

    describe 'into' do
      it 'takes an engine' do
        manager = Arel::InsertManager.new Table.engine
        manager.into(Table.new(:users)).should == manager
      end
    end

    describe 'to_sql' do
      it 'converts to sql' do
        table   = Table.new :users
        manager = Arel::InsertManager.new Table.engine
        manager.into table
        manager.to_sql.should be_like %{
          INSERT INTO "users"
        }
      end
    end
  end
end