Allow target and local target comparison

This way we'll be able to sort a mixed collection of targets and local
targets.
This commit is contained in:
Javi Martín
2021-01-20 19:15:43 +01:00
parent e96f45ba39
commit d3f72b100e
4 changed files with 46 additions and 8 deletions

View File

@@ -73,5 +73,13 @@ describe SDG::LocalTarget do
expect(local_target).to be > lesser_local_target
expect(local_target).to be < greater_local_target
end
it "can be compared against global targets" do
lesser_target = build(:sdg_target, code: "10.A", goal: SDG::Goal[10])
greater_target = build(:sdg_target, code: "11.1", goal: SDG::Goal[11])
expect(local_target).to be > lesser_target
expect(local_target).to be < greater_target
end
end
end