spec/middleware_spec.rb in utf8-cleaner-0.2.0 vs spec/middleware_spec.rb in utf8-cleaner-0.2.1

- old
+ new

@@ -54,9 +54,19 @@ it "leaves the body alone" do env['rack.input'].rewind expect(new_env['rack.input'].read).to eq "foo=%FFbar%F8" end end + + describe "when json data is POSTed" do + before do + env['CONTENT_TYPE'] = 'application/json' + end + it "removes removes invalid %-encoded UTF-8 sequences" do + env['rack.input'].rewind + expect(new_env['rack.input'].read).to eq('foo=bar') + end + end end describe "with a minimal env" do let(:env) do {