Rspec2 Missing template Error
Upgraded form Rails 2 to 3. And RSpec 1 to 2. It looks like capybara/webrat is trying to find the template when I only want it to find the action. What is a possible workaround?
The error
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
app/controllers/feed_entries_controller#read
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
spec/controllers/feed_entries_controller_spec.rb:200
delete :read, :id => @feed_entry.id, :format =&开发者_如何学Cgt; 'json'
It seems you can't do render :nothing => true
with a status different from 200. An alternative is not using render
, but using head :no_content
.
精彩评论