Hello to all; when writing tests from controller to controller using rspec, I found that I was duplicating several basic tests, such as this check for the index:
describe "on GET to index" do it "renders the index template" do get :index response.should render_template('index') end end
I feel the test is important, just redundant when added to five different controllers. Is there a way to share tests between controller classes or include specific blocks of code with a method call in rspec? Or is it best practice for duplication, in this case?
source share