+ def test_event_valid
+ ok = %w[opened closed reopened commented hidden]
+ bad = %w[expropriated fubared]
+
+ ok.each do |event|
+ note_comment = create(:note_comment)
+ note_comment.event = event
+ assert note_comment.valid?, "#{event} is invalid, when it should be"
+ end
+
+ bad.each do |event|
+ note_comment = create(:note_comment)
+ note_comment.event = event
+ assert !note_comment.valid?, "#{event} is valid when it shouldn't be"
+ end
+ end