aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNick Kallen <nkallen@nick-kallens-computer-2.local>2008-03-12 00:12:41 -0700
committerNick Kallen <nkallen@nick-kallens-computer-2.local>2008-03-12 00:12:41 -0700
commit46da601b2f5507325bba279d5c12ed88ce9e685e (patch)
tree5f31169e51084e85f34546e483e3d1a225047002
parent181f28e2f9ddd1aa8e78709c45368ade9585287a (diff)
downloadrails-46da601b2f5507325bba279d5c12ed88ce9e685e.tar.gz
rails-46da601b2f5507325bba279d5c12ed88ce9e685e.tar.bz2
rails-46da601b2f5507325bba279d5c12ed88ce9e685e.zip
more inadequate tests
-rw-r--r--spec/active_relation/unit/primitives/attribute_spec.rb6
-rw-r--r--spec/active_relation/unit/relations/table_spec.rb15
2 files changed, 12 insertions, 9 deletions
diff --git a/spec/active_relation/unit/primitives/attribute_spec.rb b/spec/active_relation/unit/primitives/attribute_spec.rb
index d424bf4dff..bdd22721b3 100644
--- a/spec/active_relation/unit/primitives/attribute_spec.rb
+++ b/spec/active_relation/unit/primitives/attribute_spec.rb
@@ -39,8 +39,10 @@ module ActiveRelation
end
describe '#column' do
- it "" do
- pending
+ it "returns the corresponding column in the relation" do
+ pending "damn mock based tests are too easy"
+ stub(@relation).column_for(@attribute) { 'bruisers' }
+ @attribute.column.should == 'bruisers'
end
end
diff --git a/spec/active_relation/unit/relations/table_spec.rb b/spec/active_relation/unit/relations/table_spec.rb
index e62f84d93a..6286ea9de1 100644
--- a/spec/active_relation/unit/relations/table_spec.rb
+++ b/spec/active_relation/unit/relations/table_spec.rb
@@ -65,6 +65,14 @@ module ActiveRelation
Attribute.new(@relation, :name)
]
end
+
+ describe '#reset' do
+ it "reloads columns from the database" do
+ pending
+ lambda { stub(@relation.engine).columns { [] } }.should_not change { @relation.attributes }
+ lambda { @relation.reset }.should change { @relation.attributes }
+ end
+ end
end
describe '#qualify' do
@@ -90,12 +98,5 @@ module ActiveRelation
Table.new(:users, engine = Engine.new).engine.should == engine
end
end
-
- describe '#reset' do
- it "reloads columns from the database" do
- lambda { stub(@relation).columns { [] } }.should_not change { @relation.attributes }
- lambda { @relation.reset }.should change { @relation.attributes }
- end
- end
end
end \ No newline at end of file