【发布时间】:2011-08-14 23:44:45
【问题描述】:
我正在尝试在我的控制器上测试更新操作的失败分支,但我在测试时遇到了问题。这就是我所拥有的,最后失败了
describe "PUT 'article/:id'" do
.
.
.
describe "with invalid params" do
it "should find the article and return the object" do
Article.stub(:find).with("1").and_return(@article)
end
it "should update the article with new attributes" do
Article.stub(:update_attributes).and_return(false)
end
it "should render the edit form" do
response.should render_template("edit")
end
end
end
关于为什么最后一部分无法呈现模板的任何想法?
【问题讨论】:
标签: ruby-on-rails-3 tdd bdd rspec2