Skip to content

Commit

Permalink
#2508 fix CI with postgres
Browse files Browse the repository at this point in the history
  • Loading branch information
bbenezech committed Feb 4, 2016
1 parent c860b2f commit c73de83
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions spec/rails_admin/support/csv_converter_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,16 +45,20 @@
end
end

context 'when encoding FROM MySQL latin1' do
let(:encoding) { '' }
let(:objects) { FactoryGirl.create_list :player, 1, number: 1, name: 'Josè'.encode('ISO-8859-1') }

it 'exports to ISO-8859-1', active_record: true do
expect(::ActiveRecord::Base.connection).to receive(:encoding) { 'latin1' }
expect(subject[1]).to eq 'ISO-8859-1'
expect(subject[2].encoding).to eq Encoding::ISO_8859_1
expect(subject[2].unpack('H*').first).
to eq '4e756d6265722c4e616d650a312c4a6f73e80a'

# postgresql cannot load invalid data: invalid byte sequence for encoding "UTF8": 0xe8
unless ActiveRecord::Base.connection_config[:adapter] == 'postgresql'
context 'when encoding FROM MySQL latin1' do
let(:encoding) { '' }
let(:objects) { FactoryGirl.create_list :player, 1, number: 1, name: 'Josè'.encode('ISO-8859-1') }

it 'exports to ISO-8859-1', active_record: true do
expect(::ActiveRecord::Base.connection).to receive(:encoding) { 'latin1' }
expect(subject[1]).to eq 'ISO-8859-1'
expect(subject[2].encoding).to eq Encoding::ISO_8859_1
expect(subject[2].unpack('H*').first).
to eq '4e756d6265722c4e616d650a312c4a6f73e80a'
end
end
end

Expand Down

2 comments on commit c73de83

@mshibuya
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So glad to see you back here 😃

@bbenezech
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Haha

I feel guilty sometimes to have left you alone for so long 😢

My god I wish we could extract all the unmaintainable stuff from core and have a clean project, that would be so sad if RailsAdmin was to die under its own weight!

I'm trying to close as many issues as possible to have a clearer view, then maybe we can roadmap a 1.0 💃

Please sign in to comment.