Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Verify poll ballots #2858

Merged
merged 2 commits into from
Apr 11, 2019
Merged

Verify poll ballots #2858

merged 2 commits into from
Apr 11, 2019

Conversation

MariaCheca
Copy link
Contributor

@MariaCheca MariaCheca commented Aug 23, 2018

References

Objectives

Verify poll ballots and create the corresponding budget ballot lines

Notes

The parts related to city_heading, which are specific to Madrid, have not been backported.

@javierm javierm force-pushed the backport_1545-budget_poll_ballot branch from b31533c to 985b9ad Compare November 13, 2018 19:09
spec/models/poll/ballot_spec.rb Outdated Show resolved Hide resolved
app/models/poll/ballot.rb Outdated Show resolved Hide resolved
@javierm javierm force-pushed the backport_1545-budget_poll_ballot branch 3 times, most recently from cbe16cb to 412e765 Compare November 13, 2018 19:14
@javierm javierm force-pushed the backport_1545-budget_poll_ballot branch from 412e765 to d573581 Compare April 10, 2019 15:30
spec/models/poll/ballot_spec.rb Outdated Show resolved Hide resolved
spec/models/poll/ballot_spec.rb Outdated Show resolved Hide resolved
spec/models/poll/ballot_spec.rb Outdated Show resolved Hide resolved
expect(poll_ballot.add_investment(investment.id)).to be(true)

other_heading = create(:budget_heading, group: group, price: 10000000)
other_investment = create(:budget_investment, :selected, price: 1000000, heading: other_heading)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Metrics/LineLength: Line is too long. [104/100] (https://github.com/bbatsov/ruby-style-guide#80-character-limits)

spec/models/poll/ballot_spec.rb Outdated Show resolved Hide resolved
poll_ballot.verify

expect(poll_ballot.ballot.lines.count).to eq(3)
expect(poll_ballot.ballot.lines.pluck(:investment_id).sort).to eq([investment.id, investment2.id, investment3.id].sort)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Metrics/LineLength: Line is too long. [125/100] (https://github.com/bbatsov/ruby-style-guide#80-character-limits)

investment3 = create(:budget_investment, :selected, price: 2000000, heading: heading)
investment4 = create(:budget_investment, :selected, price: 2000000, heading: heading)

poll_ballot.update(data: [investment.id, investment2.id, investment3.id, investment4.id].join(","))

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Metrics/LineLength: Line is too long. [105/100] (https://github.com/bbatsov/ruby-style-guide#80-character-limits)

let(:investment){ create(:budget_investment, :selected, price: 5000000, heading: heading) }
let(:poll) { create(:poll, budget: budget) }
let(:poll_ballot_sheet) { create(:poll_ballot_sheet, poll: poll) }
let(:poll_ballot) { create(:poll_ballot, ballot_sheet: poll_ballot_sheet, external_id: 1, data: investment.id) }

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Metrics/LineLength: Line is too long. [114/100] (https://github.com/bbatsov/ruby-style-guide#80-character-limits)

spec/models/poll/ballot_spec.rb Outdated Show resolved Hide resolved
spec/factories/polls.rb Outdated Show resolved Hide resolved
@javierm javierm force-pushed the backport_1545-budget_poll_ballot branch from d573581 to ea8477c Compare April 10, 2019 15:48
@javierm javierm force-pushed the backport_1545-budget_poll_ballot branch from ea8477c to ea8ef72 Compare April 10, 2019 16:17
@javierm javierm force-pushed the backport_1545-budget_poll_ballot branch from ea8ef72 to aeb8410 Compare April 10, 2019 16:29
@javierm javierm changed the title [Backport] Verify poll ballots Verify poll ballots Apr 10, 2019
@javierm javierm merged commit a0a871d into master Apr 11, 2019
@javierm javierm deleted the backport_1545-budget_poll_ballot branch April 11, 2019 10:10
@voodoorai2000 voodoorai2000 added this to Release 1.0.0-beta in Roadmap Apr 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants