1 # frozen_string_literal: true
5 class NoteCommentTest < ActiveSupport::TestCase
7 ok = %w[opened closed reopened commented hidden]
8 bad = %w[expropriated fubared]
11 note_comment = create(:note_comment)
12 note_comment.event = event
13 assert_predicate note_comment, :valid?, "#{event} is invalid, when it should be"
17 note_comment = create(:note_comment)
18 note_comment.event = event
19 assert_not_predicate note_comment, :valid?, "#{event} is valid when it shouldn't be"
24 ok = %W[Name vergrößern foo\nbar
26 bad = ["foo\x00bar", "foo\x08bar", "foo\x1fbar", "foo\x7fbar",
27 "foo\ufffebar", "foo\uffffbar"]
30 note_comment = create(:note_comment)
31 note_comment.body = body
32 assert_predicate note_comment, :valid?, "#{body} is invalid, when it should be"
36 note_comment = create(:note_comment)
37 note_comment.body = body
38 assert_not_predicate note_comment, :valid?, "#{body} is valid when it shouldn't be"