FIX: prevent pollception

This commit is contained in:
Régis Hanol
2015-05-13 23:12:53 +02:00
parent 8fa109638b
commit 7c545537a6
2 changed files with 18 additions and 5 deletions

View File

@ -65,6 +65,15 @@ describe PostsController do
expect(json["polls"]).to be
end
it "prevents pollception" do
xhr :post, :create, { title: title, raw: "[poll name=1]\n- A\n[poll name=2]\n- B\n- C\n[/poll]\n- D\n[/poll]" }
expect(response).to be_success
json = ::JSON.parse(response.body)
expect(json["cooked"]).to match("data-poll-")
expect(json["polls"]["1"]).to_not be
expect(json["polls"]["2"]).to be
end
describe "edit window" do
describe "within the first 5 minutes" do