Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

added spec for validation fix

Signed-off-by: Luke Francl <look@recursion.org>
  • Loading branch information...
commit 5de6504cca7f912fc6a5e92ec61db8b58bac4aeb 1 parent 0e0dd0c
@redinger redinger authored look committed
Showing with 7 additions and 1 deletion.
  1. +1 −0  test/models/comment.rb
  2. +6 −1 test/xss_terminate_test.rb
View
1  test/models/comment.rb
@@ -2,4 +2,5 @@
class Comment < ActiveRecord::Base
belongs_to :entry
belongs_to :person
+ validates_presence_of :title
end
View
7 test/xss_terminate_test.rb
@@ -63,5 +63,10 @@ def test_active_record_session_store_does_not_cause_nil_exception
session = CGI::Session::ActiveRecordStore::Session.new(:session_id => 'foo', :data => 'blah')
assert session.save
end
-
+
+ def test_do_not_save_invalid_models_after_sanitizing
+ c = Comment.new(:title => "<br />")
+ assert !c.save
+ assert_not_nil c.errors.on(:title)
+ end
end
Please sign in to comment.
Something went wrong with that request. Please try again.