Feature #22913 » 20160606_auto_select_fields_test.patch
| /dev/null → test/fixtures/files/import_auto_mapping.csv | ||
|---|---|---|
|
Column 0,Column 1,Column 2,Subject,Column 4,Database,Column 6
|
||
|
0,1,2,3,4,5,6
|
||
| test/functional/imports_controller_test.rb | ||
|---|---|---|
|
end
|
||
|
end
|
||
|
def test_get_mapping_should_auto_select_by_column_name
|
||
|
import = generate_import('import_auto_mapping.csv')
|
||
|
import.settings = {'separator' => ',', 'wrapper'=> '""', 'encoding' => 'ISO-8859-1'}
|
||
|
import.save!
|
||
|
|
||
|
get :mapping, :id => import.to_param
|
||
|
assert_response :success
|
||
|
|
||
|
assert_select 'select[name=?]', 'import_settings[mapping][subject]' do
|
||
|
assert_select 'option[value="3"][selected="selected"]', :text => 'Subject'
|
||
|
end
|
||
|
assert_select 'select[name=?]', 'import_settings[mapping][cf_1]' do
|
||
|
assert_select 'option[value="5"][selected="selected"]', :text => 'Database'
|
||
|
end
|
||
|
end
|
||
|
|
||
|
def test_post_mapping_should_update_mapping
|
||
|
import = generate_import('import_iso8859-1.csv')
|
||