I'm facing a problem with rspec and controllers
i'm spec'ing an update action, so to do it i call the following code:
put :update, :id => "1", :ntp => {:name=>'myservah'}
My controller has the following code:
def update
if @ntp.update_attributes(params[:ntp])
flash.now[:notice] = "Successfully updated ntp."
else
flash.now[:error] = ((errors_to_a(@ntp)*'.<br />')+'.')
end
render :partial => 'update'
end
And i'm getting the following error:
Failure/Error: put :update, :id => "1", :ntp => {:name=>'myservah'} Missing partial ntps/update with {:handlers=>[:erb, :rjs, :builder, :rhtml, :rxml], :formats=>[:html], :locale=>[:en, :en]} in view paths "#"
My question is: should i explicit say which handler i have? Today my partial is named '_update.js.erb'.
BTW, my code works, i render the "js" version of update, since i just run some scripts