aboutsummaryrefslogtreecommitdiffstats
path: root/spec/arel
diff options
context:
space:
mode:
authorEmilio Tagua <miloops@gmail.com>2009-04-23 13:01:18 -0300
committerEmilio Tagua <miloops@gmail.com>2009-04-23 13:01:18 -0300
commit7978b69948c4fe38911932766d45026467f45e52 (patch)
treefc410bfe209e1abc98ae2f0cf1247f55efb0471a /spec/arel
parentb29268d5b64bbd7383bfcebc6fcc5e97a657885b (diff)
downloadrails-7978b69948c4fe38911932766d45026467f45e52.tar.gz
rails-7978b69948c4fe38911932766d45026467f45e52.tar.bz2
rails-7978b69948c4fe38911932766d45026467f45e52.zip
Use the engine not the engine.connection, the engine may not even respond to connection
Diffstat (limited to 'spec/arel')
-rw-r--r--spec/arel/unit/session/session_spec.rb32
1 files changed, 16 insertions, 16 deletions
diff --git a/spec/arel/unit/session/session_spec.rb b/spec/arel/unit/session/session_spec.rb
index 7582aa35e1..6e73d74f2d 100644
--- a/spec/arel/unit/session/session_spec.rb
+++ b/spec/arel/unit/session/session_spec.rb
@@ -6,7 +6,7 @@ module Arel
@relation = Table.new(:users)
@session = Session.new
end
-
+
describe '::start' do
describe '::instance' do
it "it is a singleton within the started session" do
@@ -23,13 +23,13 @@ module Arel
end
end
end
-
+
it "manufactures new sessions outside of the started session" do
Session.new.should_not == Session.new
end
end
end
-
+
describe Session::CRUD do
before do
@insert = Insert.new(@relation, @relation[:name] => 'nick')
@@ -37,48 +37,48 @@ module Arel
@delete = Deletion.new(@relation)
@read = @relation
end
-
+
describe '#create' do
it "executes an insertion on the connection" do
- mock(@insert).call(@insert.engine.connection)
+ mock(@insert).call(@insert.engine)
@session.create(@insert)
end
end
-
+
describe '#read' do
it "executes an selection on the connection" do
- mock(@read).call(@read.engine.connection)
+ mock(@read).call(@read.engine)
@session.read(@read)
end
-
+
it "is memoized" do
- mock(@read).call(@read.engine.connection).once
+ mock(@read).call(@read.engine).once
@session.read(@read)
@session.read(@read)
end
end
-
+
describe '#update' do
it "executes an update on the connection" do
- mock(@update).call(@update.engine.connection)
+ mock(@update).call(@update.engine)
@session.update(@update)
end
end
-
+
describe '#delete' do
it "executes a delete on the connection" do
- mock(@delete).call(@delete.engine.connection)
+ mock(@delete).call(@delete.engine)
@session.delete(@delete)
end
end
end
-
+
describe 'Transactions' do
describe '#begin' do
end
-
+
describe '#end' do
end
end
end
-end \ No newline at end of file
+end