Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

added attr_protected to spam_status

  • Loading branch information...
commit f37f6d8be103999fed876f5a7dc6eedaf7d5b62b 1 parent 7fde106
rsl authored
View
1  lib/lucky_sneaks/acts_as_snook.rb
@@ -42,6 +42,7 @@ def acts_as_snook(options = {})
before_validation :calculate_snook_score
attr_reader :snook_credits
+ attr_protected fields_for_snooking[:spam_status_field]
end
# Returns all instances which have been marked as safe for display
View
5 test/acts_as_snook_interface_test.rb
@@ -63,4 +63,9 @@ def test_collates_comments_needing_moderation
Comment.delete_all
end
+
+ def test_cannot_mass_assign_spam_status
+ @comment = bad_comment(:spam_status => "ham")
+ assert_not_equal "ham", @comment.spam_status
+ end
end
View
6 test/test_helper.rb
@@ -20,6 +20,12 @@
require File.join(File.dirname(__FILE__), 'schema')
require File.join(File.dirname(__FILE__), 'comment')
+# To shut up whining about writing to the nil logger
+class NilClass
+ def debug(*args)
+ end
+end
+
class Test::Unit::TestCase # :nodoc:
def link
"<a href='http://lipsum.com/'>lorem ipsum</a>"
Please sign in to comment.
Something went wrong with that request. Please try again.