aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorVipul A M <vipulnsward@gmail.com>2014-06-15 14:22:06 +0530
committerVipul A M <vipulnsward@gmail.com>2014-06-15 14:22:06 +0530
commit54f412ae8ce5bb291de4aedb9af69a354b54d7b1 (patch)
tree1008e6b1f82027f09f196bb5acea2b8a6c4eb746 /test
parent9ea4d4689711d86777715360da47ae25c0acc337 (diff)
downloadrails-54f412ae8ce5bb291de4aedb9af69a354b54d7b1.tar.gz
rails-54f412ae8ce5bb291de4aedb9af69a354b54d7b1.tar.bz2
rails-54f412ae8ce5bb291de4aedb9af69a354b54d7b1.zip
- Test noop when passing empty list to `insert`
- Rename into test to indicate it accepts table and chains on it - Rename "combo" test to what it actually tests
Diffstat (limited to 'test')
-rw-r--r--test/test_insert_manager.rb11
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