List local targets alongside targets

This commit is contained in:
Javi Martín
2021-01-20 19:56:17 +01:00
parent 176839c905
commit 39d68a1779
2 changed files with 12 additions and 2 deletions

View File

@@ -60,6 +60,13 @@ describe SDG::Relatable do
expect(relatable.sdg_target_list).to eq "1.2, 2.1, 2.2"
end
it "includes both targets and local targets in order" do
relatable.sdg_global_targets = [SDG::Target[2.2], SDG::Target[1.2], SDG::Target[2.1]]
relatable.sdg_local_targets = %w[1.1.1 2.1.3].map { |code| create(:sdg_local_target, code: code) }
expect(relatable.sdg_target_list).to eq "1.1.1, 1.2, 2.1, 2.1.3, 2.2"
end
end
describe "#sdg_local_targets" do