Get rid of 500 on mobile comment creation
This commit is contained in:
parent
6946d28243
commit
5e39368414
2 changed files with 5 additions and 1 deletions
|
|
@ -28,7 +28,7 @@ class CommentsController < ApplicationController
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.js{ render(:create, :status => 201)}
|
format.js{ render(:create, :status => 201)}
|
||||||
format.html{ render :nothing => true, :status => 201 }
|
format.html{ render :nothing => true, :status => 201 }
|
||||||
format.mobile{ redirect_to @comment.post }
|
format.mobile{ redirect_to post_url(@comment.post) }
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
render :nothing => true, :status => 422
|
render :nothing => true, :status => 422
|
||||||
|
|
|
||||||
|
|
@ -29,6 +29,10 @@ describe CommentsController do
|
||||||
response.code.should == '201'
|
response.code.should == '201'
|
||||||
response.body.should match comment_hash[:text]
|
response.body.should match comment_hash[:text]
|
||||||
end
|
end
|
||||||
|
it 'responds to format mobile' do
|
||||||
|
post :create, comment_hash.merge(:format => 'mobile')
|
||||||
|
response.should be_redirect
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
context "on a post from a contact" do
|
context "on a post from a contact" do
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue