Simplify code testing investment ids

This commit is contained in:
Javi Martín
2023-07-18 18:30:28 +02:00
parent b8ed81c5b8
commit cebd6ddb30

View File

@@ -19,7 +19,7 @@ describe Poll::Ballot do
poll_ballot.update!(data: [investment.id, investment2.id, investment3.id, investment4.id].join(",")) poll_ballot.update!(data: [investment.id, investment2.id, investment3.id, investment4.id].join(","))
poll_ballot.verify poll_ballot.verify
expect(poll_ballot.ballot.lines.pluck(:investment_id)).to match_array [investment.id, investment2.id, investment3.id] expect(poll_ballot.ballot.investment_ids).to match_array [investment.id, investment2.id, investment3.id]
end end
it "adds ballot lines if they are from valid headings" do it "adds ballot lines if they are from valid headings" do
@@ -32,7 +32,7 @@ describe Poll::Ballot do
poll_ballot.update!(data: [investment.id, investment2.id, investment3.id, investment4.id].join(",")) poll_ballot.update!(data: [investment.id, investment2.id, investment3.id, investment4.id].join(","))
poll_ballot.verify poll_ballot.verify
expect(poll_ballot.ballot.lines.pluck(:investment_id)).to match_array [investment.id, investment2.id, investment3.id] expect(poll_ballot.ballot.investment_ids).to match_array [investment.id, investment2.id, investment3.id]
end end
it "adds ballot lines if they are from selectable" do it "adds ballot lines if they are from selectable" do
@@ -43,7 +43,7 @@ describe Poll::Ballot do
poll_ballot.update!(data: [investment.id, investment2.id, investment3.id, investment4.id].join(",")) poll_ballot.update!(data: [investment.id, investment2.id, investment3.id, investment4.id].join(","))
poll_ballot.verify poll_ballot.verify
expect(poll_ballot.ballot.lines.pluck(:investment_id)).to match_array [investment.id, investment2.id, investment3.id] expect(poll_ballot.ballot.investment_ids).to match_array [investment.id, investment2.id, investment3.id]
end end
end end