diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2010-12-02 14:01:08 -0800 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2010-12-02 14:01:08 -0800 |
commit | baa660f62b4fae9197d7b4b6e4bbcf4059d106a8 (patch) | |
tree | 9757fa9803cd4035450f2efe1196cfa8afd4f875 /test | |
parent | 39ccb8049c87b1fde1b85c6a0d84e0f72e92bac1 (diff) | |
download | rails-baa660f62b4fae9197d7b4b6e4bbcf4059d106a8.tar.gz rails-baa660f62b4fae9197d7b4b6e4bbcf4059d106a8.tar.bz2 rails-baa660f62b4fae9197d7b4b6e4bbcf4059d106a8.zip |
deprecating "insert"
Diffstat (limited to 'test')
-rw-r--r-- | test/helper.rb | 2 | ||||
-rw-r--r-- | test/test_table.rb | 12 |
2 files changed, 13 insertions, 1 deletions
diff --git a/test/helper.rb b/test/helper.rb index 3f9ac22447..f13596f9ec 100644 --- a/test/helper.rb +++ b/test/helper.rb @@ -8,6 +8,6 @@ Arel::Table.engine = Arel::Sql::Engine.new(FakeRecord::Base.new) class Object def must_be_like other - self.gsub(/\s+/, ' ').strip.must_equal other.gsub(/\s+/, ' ').strip + gsub(/\s+/, ' ').strip.must_equal other.gsub(/\s+/, ' ').strip end end diff --git a/test/test_table.rb b/test/test_table.rb index 8d37a8eaff..b9998174a1 100644 --- a/test/test_table.rb +++ b/test/test_table.rb @@ -6,6 +6,18 @@ module Arel @relation = Table.new(:users) end + it 'should return an insert manager' do + im = @relation.compile_insert 'VALUES(NULL)' + assert_kind_of Arel::InsertManager, im + assert_equal 'INSERT INTO NULL VALUES(NULL)', im.to_sql + end + + it 'should return IM from insert_manager' do + im = @relation.insert_manager + assert_kind_of Arel::InsertManager, im + assert_equal im.engine, @relation.engine + end + describe 'skip' do it 'should add an offset' do sm = @relation.skip 2 |