4
Hey all;以书面形式从控制器测试使用RSpec到控制器,我发现自己复制了一些基本的测试,像这样的检查指标:当添加到五在类之间共享Rspec测试
describe "on GET to index" do
it "renders the index template" do
get :index
response.should render_template('index')
end
end
我觉得这个测试很重要,只是多余的,不同的控制器有没有办法在控制器类之间共享测试,或者在rspec中包含特定的代码块和方法调用?或者在这种情况下复制最佳实践?
对不起,最近的答案 - 这很好,非常感谢! – 2010-12-04 03:36:32