-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #683 from mgcam/extend_validation_glob
allow the dot character in QC outcomes database fields
- Loading branch information
Showing
3 changed files
with
9 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -293,7 +293,7 @@ subtest 'update outcome' => sub { | |
}; | ||
|
||
subtest 'sanitize' => sub { | ||
plan tests => 14; | ||
plan tests => 16; | ||
|
||
my $p = 'npg_qc::Schema::Result::UqcOutcomeEnt'; | ||
throws_ok { $p->sanitize_value() } qr/Input undefined/, | ||
|
@@ -316,13 +316,16 @@ subtest 'sanitize' => sub { | |
qr/Illegal characters/, 'double quotes are not accepted'; | ||
throws_ok { $p->sanitize_value(q{email someone's friend}) } | ||
qr/Illegal characters/, 'single quotes are not accepted'; | ||
|
||
lives_ok { $p->sanitize_value(q{email someone#s friend}) } | ||
'hashes are accepted'; | ||
throws_ok { $p->sanitize_value('email [email protected]') } | ||
qr/Illegal characters/, 'email address is not allowed'; | ||
throws_ok { $p->sanitize_value('form <th>some</th>') } | ||
qr/Illegal characters/, 'HTML is not allowed'; | ||
throws_ok { $p->sanitize_value('<script>console.log();</script>') } | ||
qr/Illegal characters/, 'JavaScript is not allowed'; | ||
lives_ok { $p->sanitize_value('robo_qc 68.2.0 artic-qc') } | ||
'standard rationale for uqc is OK'; | ||
}; | ||
|
||
1; |