升级后的表格Rails 2到3.并且RSpec 1到2.看起来像capybara / webrat试图找到模板时我只希望它找到动作。什么是可能的解决方法?
Failure/Error: delete :read, :id => @feed_entry.id, :format => 'json'
Missing template feed_entries/read with {:handlers=>[:erb, :rjs, :rhtml, :rxml, :builder], :formats=>[:json], :locale=>[:en, :en]} in view paths "/Users/maletor/Sites/3md/app/views", ...
# ./app/controllers/feed_entries_controller.rb:37:in `read'
# ./app/controllers/feed_entries_controller.rb:35:in `read'
# ./spec/controllers/feed_entries_controller_spec.rb:200
def read
if request.post?
@feed_entry.read_by(current_account)
elsif request.delete?
@feed_entry.unread_by(current_account)
end
respond_to do |format|
format.html { redirect_to topic_path(params[:topic_id]) }
format.json { render :nothing => :true, :status => :no_content }
format.plist { render :nothing => :true, :status => :no_content }
end
end
delete :read, :id => @feed_entry.id, :format => 'json'
答案 0 :(得分:2)
您似乎无法render :nothing => true
状态与200不同。另一种方法是使用render
,而是使用head :no_content
。