diff options
author | Matthew Somerville <matthew-github@dracos.co.uk> | 2016-09-29 15:06:07 +0100 |
---|---|---|
committer | Matthew Somerville <matthew-github@dracos.co.uk> | 2016-09-29 16:34:43 +0100 |
commit | 179845c83b1a17f56c779e8f0e89317c57fa84b8 (patch) | |
tree | 67ac240b1ec678147be6354ecbe1b02e0d4b7d62 /perllib/FixMyStreet | |
parent | 78b34d4543c1c3808851351a9f083789a99c72c9 (diff) |
Factor out contains_or_lacks test function.
Diffstat (limited to 'perllib/FixMyStreet')
-rw-r--r-- | perllib/FixMyStreet/TestMech.pm | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/perllib/FixMyStreet/TestMech.pm b/perllib/FixMyStreet/TestMech.pm index 54c39ffb9..122a5d0c9 100644 --- a/perllib/FixMyStreet/TestMech.pm +++ b/perllib/FixMyStreet/TestMech.pm @@ -282,6 +282,16 @@ sub get_first_email { return $email_as_string; } +=head2 contains_or_lacks + +Based upon boolean FLAG, checks that content contains or lacks TEXT. + +=cut + +sub contains_or_lacks { + my ($mech, $flag, $text) = @_; + $flag ? $mech->content_contains($text) : $mech->content_lacks($text); +} =head2 page_errors |