Skip to content

Commit

Permalink
Test enforce_valid_utf8 with russian chars.
Browse files Browse the repository at this point in the history
  • Loading branch information
Jon de Andres committed Apr 2, 2015
1 parent a4578a3 commit 8391c4e
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions spec/rollbar_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1336,6 +1336,19 @@ def backtrace
end

context 'enforce_valid_utf8' do
context 'with utf8 string and ruby > 1.8' do
next unless String.instance_methods.include?(:force_encoding)

let(:payload) { { :foo => 'Изменение' } }

it 'just returns the same string' do
payload_copy = payload.clone
notifier.send(:enforce_valid_utf8, payload_copy)

expect(payload_copy[:foo]).to be_eql('Изменение')
end
end

it 'should replace invalid utf8 values' do
bad_key = force_to_ascii("inner \x92bad key")

Expand Down

0 comments on commit 8391c4e

Please sign in to comment.