From cebd6ddb3081a1275a9feff8ca70586275ad0e14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Tue, 18 Jul 2023 18:30:28 +0200 Subject: [PATCH] Simplify code testing investment ids --- spec/models/poll/ballot_spec.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/spec/models/poll/ballot_spec.rb b/spec/models/poll/ballot_spec.rb index 54f292020..1cebae0a2 100644 --- a/spec/models/poll/ballot_spec.rb +++ b/spec/models/poll/ballot_spec.rb @@ -19,7 +19,7 @@ describe Poll::Ballot do poll_ballot.update!(data: [investment.id, investment2.id, investment3.id, investment4.id].join(",")) 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 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.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 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.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