Remove deprecated on hold budget phase group, no longer used in code

This commit is contained in:
Bertocq
2018-01-14 20:41:24 +01:00
parent 7ccb506d64
commit 7179dbbba0
3 changed files with 1 additions and 36 deletions

View File

@@ -5,7 +5,6 @@ class Budget < ActiveRecord::Base
PHASES = %w(drafting accepting reviewing selecting valuating publishing_prices PHASES = %w(drafting accepting reviewing selecting valuating publishing_prices
balloting reviewing_ballots finished).freeze balloting reviewing_ballots finished).freeze
ON_HOLD_PHASES = %w(reviewing valuating publishing_prices reviewing_ballots).freeze
PUBLISHED_PRICES_PHASES = %w(publishing_prices balloting reviewing_ballots finished).freeze PUBLISHED_PRICES_PHASES = %w(publishing_prices balloting reviewing_ballots finished).freeze
CURRENCY_SYMBOLS = %w(€ $ £ ¥).freeze CURRENCY_SYMBOLS = %w(€ $ £ ¥).freeze
@@ -22,7 +21,6 @@ class Budget < ActiveRecord::Base
before_validation :sanitize_descriptions before_validation :sanitize_descriptions
scope :on_hold, -> { where(phase: ON_HOLD_PHASES) }
scope :drafting, -> { where(phase: "drafting") } scope :drafting, -> { where(phase: "drafting") }
scope :accepting, -> { where(phase: "accepting") } scope :accepting, -> { where(phase: "accepting") }
scope :reviewing, -> { where(phase: "reviewing") } scope :reviewing, -> { where(phase: "reviewing") }
@@ -95,10 +93,6 @@ class Budget < ActiveRecord::Base
balloting_process? || finished? balloting_process? || finished?
end end
def on_hold?
ON_HOLD_PHASES.include?(phase)
end
def current? def current?
!finished? !finished?
end end

View File

@@ -551,7 +551,7 @@ describe Budget::Investment do
end end
it "rejects selections when selecting is not allowed (via admin setting)" do it "rejects selections when selecting is not allowed (via admin setting)" do
budget.phase = "on_hold" budget.phase = "reviewing"
expect(district_sp.reason_for_not_being_selectable_by(user)).to eq(:no_selecting_allowed) expect(district_sp.reason_for_not_being_selectable_by(user)).to eq(:no_selecting_allowed)
end end

View File

@@ -68,35 +68,6 @@ describe Budget do
expect(budget).to be_finished expect(budget).to be_finished
end end
it "on_hold?" do
budget.phase = "drafting"
expect(budget).not_to be_on_hold
budget.phase = "accepting"
expect(budget).not_to be_on_hold
budget.phase = "reviewing"
expect(budget).to be_on_hold
budget.phase = "selecting"
expect(budget).not_to be_on_hold
budget.phase = "valuating"
expect(budget).to be_on_hold
budget.phase = "publishing_prices"
expect(budget).to be_on_hold
budget.phase = "balloting"
expect(budget).not_to be_on_hold
budget.phase = "reviewing_ballots"
expect(budget).to be_on_hold
budget.phase = "finished"
expect(budget).not_to be_on_hold
end
it "balloting_or_later?" do it "balloting_or_later?" do
budget.phase = "drafting" budget.phase = "drafting"
expect(budget).not_to be_balloting_or_later expect(budget).not_to be_balloting_or_later