Add specs for description sanitisation

This commit is contained in:
kikito
2015-07-31 16:10:20 +02:00
parent 8d9f9a21a4
commit 824ce3c8fe
2 changed files with 23 additions and 0 deletions

View File

@@ -25,6 +25,12 @@ describe Debate do
expect(@debate).to_not be_valid
end
it "should sanitize the description" do
@debate.description = "<script>alert('danger');</script>"
@debate.valid?
expect(@debate.description).to eq("alert('danger');")
end
it "should not be valid without accepting terms of service" do
@debate.terms_of_service = nil
expect(@debate).to_not be_valid