Update tests for singular error messages
parent
4fb54ea5c8
commit
8a4c6fa8b1
|
@ -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."
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in New Issue