aboutsummaryrefslogtreecommitdiffstats
path: root/spec
diff options
context:
space:
mode:
authorEmilio Tagua <miloops@gmail.com>2009-07-01 20:29:33 -0300
committerEmilio Tagua <miloops@gmail.com>2009-07-01 20:29:33 -0300
commit808b9e90a38c6c19e109da8eb5f2a264fd780d9a (patch)
treede89ed495a0462f5e2c74be9fa3dbacae7c18124 /spec
parent97811698ab0e68b33fbf3067c3764e385dd75d53 (diff)
downloadrails-808b9e90a38c6c19e109da8eb5f2a264fd780d9a.tar.gz
rails-808b9e90a38c6c19e109da8eb5f2a264fd780d9a.tar.bz2
rails-808b9e90a38c6c19e109da8eb5f2a264fd780d9a.zip
Allow SQL strings to insert query. Insert should better return engine's result.
Diffstat (limited to 'spec')
-rw-r--r--spec/arel/engines/memory/integration/joins/cross_engine_spec.rb5
-rw-r--r--spec/arel/engines/memory/unit/relations/insert_spec.rb14
2 files changed, 9 insertions, 10 deletions
diff --git a/spec/arel/engines/memory/integration/joins/cross_engine_spec.rb b/spec/arel/engines/memory/integration/joins/cross_engine_spec.rb
index bffecc9182..07228bb0f7 100644
--- a/spec/arel/engines/memory/integration/joins/cross_engine_spec.rb
+++ b/spec/arel/engines/memory/integration/joins/cross_engine_spec.rb
@@ -10,9 +10,8 @@ module Arel
], [:id, :name])
@photos = Table.new(:photos)
@photos.delete
- @photos \
- .insert(@photos[:id] => 1, @photos[:user_id] => 1, @photos[:camera_id] => 6) \
- .insert(@photos[:id] => 2, @photos[:user_id] => 2, @photos[:camera_id] => 42)
+ @photos.insert(@photos[:id] => 1, @photos[:user_id] => 1, @photos[:camera_id] => 6)
+ @photos.insert(@photos[:id] => 2, @photos[:user_id] => 2, @photos[:camera_id] => 42)
end
describe 'when the in memory relation is on the left' do
diff --git a/spec/arel/engines/memory/unit/relations/insert_spec.rb b/spec/arel/engines/memory/unit/relations/insert_spec.rb
index 59e43328a3..873737e3b5 100644
--- a/spec/arel/engines/memory/unit/relations/insert_spec.rb
+++ b/spec/arel/engines/memory/unit/relations/insert_spec.rb
@@ -14,13 +14,13 @@ module Arel
it "manufactures an array of hashes of attributes to values" do
@relation \
.insert(@relation[:id] => 4, @relation[:name] => 'guinea fowl') \
- .let do |relation|
- relation.call.should == [
- Row.new(relation, [1, 'duck']),
- Row.new(relation, [2, 'duck']),
- Row.new(relation, [3, 'goose']),
- Row.new(relation, [4, 'guinea fowl'])
- ]
+ do |relation|
+ relation.should == [
+ Row.new(relation, [1, 'duck']),
+ Row.new(relation, [2, 'duck']),
+ Row.new(relation, [3, 'goose']),
+ Row.new(relation, [4, 'guinea fowl'])
+ ]
end
end
end