diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2014-06-15 14:11:48 -0300 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2014-06-15 14:11:48 -0300 |
commit | cd0d1492d3d788f662e93c4cba561343a86a3181 (patch) | |
tree | 1008e6b1f82027f09f196bb5acea2b8a6c4eb746 | |
parent | 9ea4d4689711d86777715360da47ae25c0acc337 (diff) | |
parent | 54f412ae8ce5bb291de4aedb9af69a354b54d7b1 (diff) | |
download | rails-cd0d1492d3d788f662e93c4cba561343a86a3181.tar.gz rails-cd0d1492d3d788f662e93c4cba561343a86a3181.tar.bz2 rails-cd0d1492d3d788f662e93c4cba561343a86a3181.zip |
Merge pull request #293 from vipulnsward/cleanup-select-manager
Cleanup Insert Manager
-rw-r--r-- | test/test_insert_manager.rb | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/test/test_insert_manager.rb b/test/test_insert_manager.rb index 4e82ca34c0..9cfd01262b 100644 --- a/test/test_insert_manager.rb +++ b/test/test_insert_manager.rb @@ -78,14 +78,19 @@ module Arel } end - it 'takes an empty list' do + it 'noop for empty list' do + table = Table.new(:users) manager = Arel::InsertManager.new Table.engine + manager.insert [[table[:id], 1]] manager.insert [] + manager.to_sql.must_be_like %{ + INSERT INTO "users" ("id") VALUES (1) + } end end describe 'into' do - it 'takes an engine' do + it 'takes a Table and chains' do manager = Arel::InsertManager.new Table.engine manager.into(Table.new(:users)).must_equal manager end @@ -126,7 +131,7 @@ module Arel end describe "combo" do - it "puts shit together" do + it "combines columns and values list in order" do table = Table.new :users manager = Arel::InsertManager.new Table.engine manager.into table |