mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
more inadequate tests
This commit is contained in:
parent
181f28e2f9
commit
46da601b2f
2 changed files with 12 additions and 9 deletions
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
Loading…
Reference in a new issue