diff options
author | Gareth Rees <gareth@mysociety.org> | 2015-06-24 11:19:43 +0100 |
---|---|---|
committer | Gareth Rees <gareth@mysociety.org> | 2015-06-24 11:19:43 +0100 |
commit | 2cce1794a4d9d2c42b83bab8a693900e8ca23ebc (patch) | |
tree | 7408a04d5ac0963ec2defbbf7d4955cff7cd62b5 /spec/lib/alaveteli_text_masker_spec.rb | |
parent | ed6b256539e0dcaa3764951d90e2dc599a8acddd (diff) | |
parent | 54ba7a4fa232ad3b57310551b9a5e19d72060abe (diff) |
Merge branch 'develop' into release-22-develop
Diffstat (limited to 'spec/lib/alaveteli_text_masker_spec.rb')
-rw-r--r-- | spec/lib/alaveteli_text_masker_spec.rb | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/spec/lib/alaveteli_text_masker_spec.rb b/spec/lib/alaveteli_text_masker_spec.rb index f2d52c1cc..f8c22a849 100644 --- a/spec/lib/alaveteli_text_masker_spec.rb +++ b/spec/lib/alaveteli_text_masker_spec.rb @@ -31,10 +31,13 @@ describe AlaveteliTextMasker do data.should == "There was a xxxxx called xxxxxxx, he wished that he was xxxx." end - it 'should handle multibyte characters correctly' do + it 'should handle multibyte characters in binary file types as binary data' do data = 'á mouse' + if String.method_defined?(:encode) + data = data.force_encoding("ASCII-8BIT") + end @regex_censor_rule.text = 'á' - apply_masks!(data, "application/octet-stream", :censor_rules => @censor_rules).should == 'x mouse' + apply_masks!(data, "application/octet-stream", :censor_rules => @censor_rules).should == 'xx mouse' end it "should apply censor rules to HTML files" do |