Skip to content

Commit

Permalink
Remove Task#employment_task_available?
Browse files Browse the repository at this point in the history
We no longer need this method as we now check the policy rather than the
task when rendering the admin view.
  • Loading branch information
rjlynch committed Nov 8, 2024
1 parent 43ac396 commit f44564b
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 39 deletions.
6 changes: 0 additions & 6 deletions app/models/task.rb
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,4 @@ def to_param
def identity_confirmation?
name == "identity_confirmation"
end

def employment_task_available?
return true unless claim.has_early_years_payments_policy?

claim.eligibility.employment_task_available?
end
end
33 changes: 0 additions & 33 deletions spec/models/task_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -54,37 +54,4 @@
end
end
end

describe "#employment_task_available?" do
subject { task.employment_task_available? }

let(:task) { build(:task, claim: claim) }
let(:claim) { create(:claim, :submitted, policy:) }

context "for claims with EarlyYearsPayments policy" do
let(:policy) { Policies::EarlyYearsPayments }

context "when the task is available" do
let(:claim) { create(:claim, :submitted, policy:, eligibility_attributes: {start_date: 1.year.ago}) }

it { is_expected.to be true }
end

context "when the task is not yet available" do
let(:claim) { create(:claim, :submitted, policy:, eligibility_attributes: {start_date: 1.day.ago}) }

it { is_expected.to be false }
end
end

context "for claims with other policies" do
(Policies.all - [Policies::EarlyYearsPayments]).each do |policy|
context policy do
let(:policy) { policy }

it { is_expected.to be true }
end
end
end
end
end

0 comments on commit f44564b

Please sign in to comment.