Skip to content
Permalink
Browse files

Follow up - 13ddd3a - Fixed issue #2981 - OTRS migration priority col…

…or wrong for 3 normal.
  • Loading branch information
rolfschmidt committed Mar 25, 2020
1 parent 39e6dbe commit 58e18b4f278757b1a4f8dc9c6411286c6b2f935c
@@ -49,12 +49,14 @@ def create(priority)

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
@@ -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"
}
@@ -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 @@ def load_priority_json(file)
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

0 comments on commit 58e18b4

Please sign in to comment.
You can’t perform that action at this time.