diff options
Diffstat (limited to 'test/test_insert_manager.rb')
-rw-r--r-- | test/test_insert_manager.rb | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/test/test_insert_manager.rb b/test/test_insert_manager.rb index 9e4cc9d05e..4e82ca34c0 100644 --- a/test/test_insert_manager.rb +++ b/test/test_insert_manager.rb @@ -139,5 +139,28 @@ module Arel } end end + + describe "select" do + + it "accepts a select query in place of a VALUES clause" do + table = Table.new :users + + manager = Arel::InsertManager.new Table.engine + manager.into table + + select = Arel::SelectManager.new Table.engine + select.project Arel.sql('1') + select.project Arel.sql('"aaron"') + + manager.select select + manager.columns << table[:id] + manager.columns << table[:name] + manager.to_sql.must_be_like %{ + INSERT INTO "users" ("id", "name") (SELECT 1, "aaron") + } + end + + end + end end |