aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLouise Crow <louise.crow@gmail.com>2012-08-14 16:51:21 +0100
committerLouise Crow <louise.crow@gmail.com>2012-08-14 16:53:27 +0100
commit86e4169d4bad7a687aa7a60082a466841bfd99d6 (patch)
tree98f58203fc299b9750763a4b963896dd59dccdbe
parent495a29cd593ac0a270ebb3bf1c1ff85f03b52e31 (diff)
Add warning about regex censor rules.
Fix spec to accommodate validation of text presence.
-rw-r--r--app/views/admin_censor_rule/_form.rhtml2
-rw-r--r--spec/models/censor_rule_spec.rb2
2 files changed, 3 insertions, 1 deletions
diff --git a/app/views/admin_censor_rule/_form.rhtml b/app/views/admin_censor_rule/_form.rhtml
index d8a8f05d7..ac43de704 100644
--- a/app/views/admin_censor_rule/_form.rhtml
+++ b/app/views/admin_censor_rule/_form.rhtml
@@ -35,4 +35,6 @@ things by individual request or by user by adding the censor rule from the
appropriate page. If you need to redact across a whole
authority, it will be easy enough to make code changes to add it, so do ask.
</p>
+<p><strong>Regexp rules that are hard to process will really slow down request display.</strong> Please only use regexps if you really need to.
+</p>
diff --git a/spec/models/censor_rule_spec.rb b/spec/models/censor_rule_spec.rb
index 1965b0894..c11b05a03 100644
--- a/spec/models/censor_rule_spec.rb
+++ b/spec/models/censor_rule_spec.rb
@@ -116,7 +116,7 @@ describe 'when validating rules' do
describe 'when the allow_global flag has been set' do
before do
- @censor_rule = CensorRule.new
+ @censor_rule = CensorRule.new(:text => 'some text')
@censor_rule.allow_global = true
end