Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ module Column
string: 'String',
text: 'String',
citext: 'String',
inet: 'String',
cidr: 'String',
macaddr: 'String',
time: 'Time',
uuid: 'Uuid',
binary: 'Binary'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,21 @@ module Parser

expect(dummy_class.get_column_type(User, column)).to eq ['Number']
end

%i[inet cidr macaddr].each do |pg_type|
it "maps Postgres #{pg_type} columns to String without logging an unknown-type message" do
logger = instance_double(Logger, log: nil)
allow(ForestAdminAgent::Facades::Container).to receive(:logger).and_return(logger)
column = instance_double(
ActiveRecord::ConnectionAdapters::SQLite3::Column,
name: 'address',
type: pg_type
)

expect(dummy_class.get_column_type(User, column)).to eq 'String'
expect(logger).not_to have_received(:log)
end
end
end

describe 'get_enum_values' do
Expand Down
Loading