1 # -*- coding: utf-8 -*-
4 class NoteCommentTest < ActiveSupport::TestCase
5 fixtures :users, :notes, :note_comments
8 ok = %w(opened closed reopened commented hidden)
9 bad = %w(expropriated fubared)
12 note_comment = note_comments(:t1)
13 note_comment.event = event
14 assert note_comment.valid?, "#{event} is invalid, when it should be"
18 note_comment = note_comments(:t1)
19 note_comment.event = event
20 assert !note_comment.valid?, "#{event} is valid when it shouldn't be"
25 ok = %W(Name vergrößern foo\nbar
27 bad = ["foo\x00bar", "foo\x08bar", "foo\x1fbar", "foo\x7fbar",
28 "foo\ufffebar", "foo\uffffbar"]
31 note_comment = note_comments(:t1)
32 note_comment.body = body
33 assert note_comment.valid?, "#{body} is invalid, when it should be"
37 note_comment = note_comments(:t1)
38 note_comment.body = body
39 assert !note_comment.valid?, "#{body} is valid when it shouldn't be"