1 # -*- coding: utf-8 -*-
4 class NoteCommentTest < ActiveSupport::TestCase
6 ok = %w[opened closed reopened commented hidden]
7 bad = %w[expropriated fubared]
10 note_comment = create(:note_comment)
11 note_comment.event = event
12 assert note_comment.valid?, "#{event} is invalid, when it should be"
16 note_comment = create(:note_comment)
17 note_comment.event = event
18 assert !note_comment.valid?, "#{event} is valid when it shouldn't be"
23 ok = %W[Name vergrößern foo\nbar
25 bad = ["foo\x00bar", "foo\x08bar", "foo\x1fbar", "foo\x7fbar",
26 "foo\ufffebar", "foo\uffffbar"]
29 note_comment = create(:note_comment)
30 note_comment.body = body
31 assert note_comment.valid?, "#{body} is invalid, when it should be"
35 note_comment = create(:note_comment)
36 note_comment.body = body
37 assert !note_comment.valid?, "#{body} is valid when it shouldn't be"