Follow up - 13ddd3af38
- Fixed issue #2981 - OTRS migration priority color wrong for 3 normal.
This commit is contained in:
parent
39e6dbe05a
commit
58e18b4f27
4 changed files with 64 additions and 0 deletions
|
@ -49,12 +49,14 @@ module Import
|
|||
|
||||
def ui_color(priority)
|
||||
return 'high-priority' if ['4 high', '5 very high'].include?(priority['Name'])
|
||||
return 'low-priority' if ['2 low', '1 very low'].include?(priority['Name'])
|
||||
|
||||
nil
|
||||
end
|
||||
|
||||
def ui_icon(priority)
|
||||
return 'important' if ['4 high', '5 very high'].include?(priority['Name'])
|
||||
return 'low-priority' if ['2 low', '1 very low'].include?(priority['Name'])
|
||||
|
||||
nil
|
||||
end
|
||||
|
|
9
spec/fixtures/import/otrs/priority/low.json
vendored
Normal file
9
spec/fixtures/import/otrs/priority/low.json
vendored
Normal file
|
@ -0,0 +1,9 @@
|
|||
{
|
||||
"ChangeBy": "1",
|
||||
"ChangeTime": "2014-04-28 10:53:18",
|
||||
"ID": "2",
|
||||
"ValidID": "1",
|
||||
"CreateTime": "2014-04-28 10:53:18",
|
||||
"CreateBy": "1",
|
||||
"Name": "2 low"
|
||||
}
|
9
spec/fixtures/import/otrs/priority/normal.json
vendored
Normal file
9
spec/fixtures/import/otrs/priority/normal.json
vendored
Normal file
|
@ -0,0 +1,9 @@
|
|||
{
|
||||
"ChangeBy": "1",
|
||||
"ChangeTime": "2014-04-28 10:53:18",
|
||||
"ID": "3",
|
||||
"ValidID": "1",
|
||||
"CreateTime": "2014-04-28 10:53:18",
|
||||
"CreateBy": "1",
|
||||
"Name": "3 normal"
|
||||
}
|
|
@ -49,4 +49,48 @@ RSpec.describe Import::OTRS::Priority do
|
|||
updates_with(zammad_structure)
|
||||
end
|
||||
end
|
||||
|
||||
context 'normal' do
|
||||
|
||||
let(:object_structure) { load_priority_json('normal') }
|
||||
let(:zammad_structure) do
|
||||
{
|
||||
created_by_id: '1',
|
||||
updated_by_id: '1',
|
||||
active: true,
|
||||
updated_at: '2014-04-28 10:53:18',
|
||||
created_at: '2014-04-28 10:53:18',
|
||||
ui_color: nil,
|
||||
ui_icon: nil,
|
||||
name: '3 normal',
|
||||
id: '3'
|
||||
}
|
||||
end
|
||||
|
||||
it 'updates' do
|
||||
updates_with(zammad_structure)
|
||||
end
|
||||
end
|
||||
|
||||
context 'low' do
|
||||
|
||||
let(:object_structure) { load_priority_json('low') }
|
||||
let(:zammad_structure) do
|
||||
{
|
||||
created_by_id: '1',
|
||||
updated_by_id: '1',
|
||||
active: true,
|
||||
updated_at: '2014-04-28 10:53:18',
|
||||
created_at: '2014-04-28 10:53:18',
|
||||
ui_color: 'low-priority',
|
||||
ui_icon: 'low-priority',
|
||||
name: '2 low',
|
||||
id: '2'
|
||||
}
|
||||
end
|
||||
|
||||
it 'updates' do
|
||||
updates_with(zammad_structure)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue