Skip to content

Commit

Permalink
Test cleanup II
Browse files Browse the repository at this point in the history
  • Loading branch information
RickCarlino committed May 11, 2020
1 parent 024bcf3 commit a445533
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions spec/mutations/sequences/mark_as_spec.rb
Expand Up @@ -58,9 +58,12 @@ def sequence(body, locals = nil)
},
},
} }
sequence(resource_update, variable_declr) do
sequence(resource_update, variable_declr) do |s|
weed_result = Points::Destroy.run(point: weed, device: device)
expect(weed_result.success?).to be false
error = weed_result.errors.message_list.first
expect(error).to include("Could not delete weed")
expect(error).to include("in use by the following sequence(s): #{s.name}")
end
end

Expand All @@ -86,9 +89,12 @@ def sequence(body, locals = nil)
},
],
}
sequence(update_resource) do
sequence(update_resource) do |s|
plant_result = Points::Destroy.run(point: plant, device: device)
expect(plant_result.success?).to be false
error = plant_result.errors.message_list.first
expect(error).to include("Could not delete plant")
expect(error).to include("in use by the following sequence(s): #{s.name}")
end
end

Expand All @@ -107,9 +113,14 @@ def sequence(body, locals = nil)
args: { label: "mounted_tool_id", value: tool.id },
},
],
}) do
}) do |s|
tool_result = Tools::Destroy.run(tool: tool, device: device)
expect(tool_result.success?).to be false
error = tool_result.errors.message_list.first
error_message1 = "the following sequences are still using it: #{s.name}"
error_message2 = "Can't delete tool or seed container"
expect(error).to include(error_message1)
expect(error).to include(error_message2)
end
end
end

0 comments on commit a445533

Please sign in to comment.