Skip to content

Commit

Permalink
added spec for validation fix
Browse files Browse the repository at this point in the history
Signed-off-by: Luke Francl <look@recursion.org>
  • Loading branch information
redinger authored and look committed Dec 19, 2008
1 parent 0e0dd0c commit 5de6504
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions test/models/comment.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
class Comment < ActiveRecord::Base
belongs_to :entry
belongs_to :person
validates_presence_of :title
end
7 changes: 6 additions & 1 deletion test/xss_terminate_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 5de6504

Please sign in to comment.