We all know that we have this code in our create action of any basic controller
def create
if @product.save
flash[:notice] = 'Product was successfully created.'
redirect_to(products_path)
else
flash[:notice] = "Data not saved try again"
render :action => "new"
end
end
how do we test this part of code using rspec
Any suggesstions are most welcome.
P.S I am naive at rspec so please mind me asking this question if the answer to this is damn simple :)