Simplify testing arrays exact contents

Instead of testing the contents of each element, we can test the whole
array at once.
This commit is contained in:
Javi Martín
2019-09-26 17:30:38 +02:00
parent 24f14ea772
commit a04a289850
10 changed files with 44 additions and 114 deletions

View File

@@ -24,10 +24,7 @@ describe GeozonesHelper do
select_options = geozone_select_options
expect(select_options.size).to eq 3
expect(select_options.first).to eq [g1.name, g1.id]
expect(select_options[1]).to eq [g2.name, g2.id]
expect(select_options.last).to eq [g3.name, g3.id]
expect(select_options).to eq [[g1.name, g1.id], [g2.name, g2.id], [g3.name, g3.id]]
end
end