aboutsummaryrefslogtreecommitdiffstats
path: root/spec/relations
diff options
context:
space:
mode:
authorCarl Lerche <carllerche@mac.com>2010-03-12 17:31:45 -0800
committerCarl Lerche <carllerche@mac.com>2010-03-12 17:31:45 -0800
commita33ab1b34e74c3b1d6f3bae4a2477527e5f8ca55 (patch)
treec897dda0f47916c96a061ffb6fdd958555613026 /spec/relations
parentc2f9f707fc56ca610fb1706886b3111dfe1d286f (diff)
downloadrails-a33ab1b34e74c3b1d6f3bae4a2477527e5f8ca55.tar.gz
rails-a33ab1b34e74c3b1d6f3bae4a2477527e5f8ca55.tar.bz2
rails-a33ab1b34e74c3b1d6f3bae4a2477527e5f8ca55.zip
Move the relation "integration" specs to specs/relations
Diffstat (limited to 'spec/relations')
-rw-r--r--spec/relations/relation_spec.rb31
1 files changed, 31 insertions, 0 deletions
diff --git a/spec/relations/relation_spec.rb b/spec/relations/relation_spec.rb
new file mode 100644
index 0000000000..808ddf1444
--- /dev/null
+++ b/spec/relations/relation_spec.rb
@@ -0,0 +1,31 @@
+require 'spec_helper'
+
+describe "Arel" do
+ before :all do
+ @engine = Arel::Testing::Engine.new
+ @relation = Arel::Model.build do |r|
+ r.engine @engine
+
+ r.attribute :id, Arel::Attributes::Integer
+ r.attribute :name, Arel::Attributes::String
+ r.attribute :age, Arel::Attributes::Integer
+ end
+ end
+
+ describe "Relation" do
+ before :all do
+ @expected = (1..20).map { |i| @relation.insert([i, nil, 2 * i]) }
+ end
+
+ it_should_behave_like 'A Relation'
+ end
+
+ describe "Relation" do
+ describe "#insert" do
+ it "inserts the row into the engine" do
+ @relation.insert([1, 'Foo', 10])
+ @engine.rows.should == [[1, 'Foo', 10]]
+ end
+ end
+ end
+end \ No newline at end of file