Update tests for singular error messages

pull/810/head
Rick Carlino 2018-04-27 11:03:33 -05:00
parent 4fb54ea5c8
commit 8a4c6fa8b1
3 changed files with 7 additions and 9 deletions

View File

@ -1,8 +1,7 @@
module Points
class Destroy < Mutations::Command
STILL_IN_USE = "Could not delete the following item(s): %s. Item(s) are "\
"in use by the following sequence(s): %s."
"in use by the following sequence(s): %s."
JUST_ONE = "Could not delete %s. Item is in use by the following "\
"sequence(s): %s."

View File

@ -24,10 +24,10 @@ describe "Point deletion edge cases" do
offset: { kind: "coordinate", args: { x: 0, y: 0, z: 0} }
},
}])
result = Points::Destroy.run(point_ids: [tool_slot.id], device: device)
errors = result.errors.message_list
expected = "Could not delete the following item(s): foo tool. Item(s) are "\
"in use by the following sequence(s): sequence."
result = Points::Destroy.run(point_ids: [tool_slot.id], device: device)
errors = result.errors.message_list
expected = "Could not delete foo tool. Item is in use by the following "\
"sequence(s): sequence."
expect(errors).to include(expected)
end
end

View File

@ -48,9 +48,8 @@ describe Points::Destroy do
point_ids = [s.tool_slot.id]
result = Points::Destroy.run(point_ids: point_ids, device: s.device)
expect(result.success?).to be(false)
expected = "Could not delete the following item(s): Scenario Tool. "\
"Item(s) are in use by the following sequence(s): Scenario "\
"Sequence."
expected = "Could not delete Scenario Tool. Item is in use by the "\
"following sequence(s): Scenario Sequence."
expect(result.errors.message_list).to include(expected)
end