Get rid of 500 on mobile comment creation

This commit is contained in:
Raphael Sofaer 2011-07-29 12:01:35 -07:00
parent 6946d28243
commit 5e39368414
2 changed files with 5 additions and 1 deletions

View file

@ -28,7 +28,7 @@ class CommentsController < ApplicationController
respond_to do |format|
format.js{ render(:create, :status => 201)}
format.html{ render :nothing => true, :status => 201 }
format.mobile{ redirect_to @comment.post }
format.mobile{ redirect_to post_url(@comment.post) }
end
else
render :nothing => true, :status => 422

View file

@ -29,6 +29,10 @@ describe CommentsController do
response.code.should == '201'
response.body.should match comment_hash[:text]
end
it 'responds to format mobile' do
post :create, comment_hash.merge(:format => 'mobile')
response.should be_redirect
end
end
context "on a post from a contact" do