aboutsummaryrefslogtreecommitdiffstats
path: root/spec/models/info_request_spec.rb
diff options
context:
space:
mode:
authorSeb Bacon <seb.bacon@gmail.com>2012-07-13 11:19:54 +0100
committerSeb Bacon <seb.bacon@gmail.com>2012-07-13 11:19:54 +0100
commit67df820b1d41402a413d1899cfdbdb4da69f7685 (patch)
treee81bff73aec870ba03bea0218d77c7e54a703c82 /spec/models/info_request_spec.rb
parent39fdae7de23244b47581c197e1d78506aebf5af1 (diff)
parent2257aad346959a843b58c61758b5daf4a58688da (diff)
Merge branch 'feature/czech-website-support' into develop
Diffstat (limited to 'spec/models/info_request_spec.rb')
-rw-r--r--spec/models/info_request_spec.rb22
1 files changed, 21 insertions, 1 deletions
diff --git a/spec/models/info_request_spec.rb b/spec/models/info_request_spec.rb
index a18a4bd1d..230884c38 100644
--- a/spec/models/info_request_spec.rb
+++ b/spec/models/info_request_spec.rb
@@ -398,7 +398,27 @@ describe InfoRequest do
it 'should return true if it is awaiting description, isn\'t the holding pen and hasn\'t had an event in 21 days' do
@info_request.is_old_unclassified?.should be_true
end
+ end
+ context "with regexp censor rule" do
+ before do
+ Time.stub!(:now).and_return(Time.utc(2007, 11, 9, 23, 59))
+ @info_request = InfoRequest.create!(:prominence => 'normal',
+ :awaiting_description => true,
+ :title => 'title',
+ :public_body => public_bodies(:geraldine_public_body),
+ :user_id => 1)
+ @censor_rule = CensorRule.create(:last_edit_editor => 1,
+ :last_edit_comment => 'comment',
+ :text => 'text',
+ :replacement => 'replacement',
+ :regexp => true)
+ end
+ it "applies regexp censor rule" do
+ body = 'text'
+ @info_request.apply_censor_rules_to_text!(body)
+ body.should == 'replacement'
+ end
end
-
+
end