FIX: You could update a topic to have a title that's too short if the TextCleaner

removed extra characters. Additionally, updating the title will not return an error
message to the client app if the operation fails (rather than failing silently.)
This commit is contained in:
Robin Ward
2013-05-31 15:22:34 -04:00
parent 2982c23265
commit d23ef1d090
6 changed files with 39 additions and 5 deletions

View File

@ -487,6 +487,11 @@ describe TopicsController do
xhr :put, :update, topic_id: @topic.id, slug: @topic.title, category: 'incredible'
end
it "returns errors with invalid titles" do
xhr :put, :update, topic_id: @topic.id, slug: @topic.title, title: 'asdf'
expect(response).not_to be_success
end
end
end
end