-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3352 from DFE-Digital/LUPEYALPHA-1174-EY-admin-em…
…ployment-task [LUPEYALPHA-1174] EY employment task
- Loading branch information
Showing
32 changed files
with
161 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
app/models/policies/early_years_payments/admin_tasks_presenter.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
module Policies | ||
module EarlyYearsPayments | ||
class AdminTasksPresenter | ||
include Admin::PresenterMethods | ||
|
||
attr_reader :claim | ||
|
||
def initialize(claim) | ||
@claim = claim | ||
end | ||
|
||
def employment | ||
[ | ||
["Current employment", claim.eligibility.eligible_ey_provider.nursery_name], | ||
["Start date", l(claim.eligibility.start_date)] | ||
] | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1451,6 +1451,9 @@ en: | |
duplicate: Duplicate | ||
no_response: No response | ||
other: Other | ||
task_questions: | ||
employment: | ||
title: Is the claimant still working at the current nursery above? | ||
early_years_payment_practitioner: | ||
journey_name: Claim an early years financial incentive payment - practitioner | ||
feedback_email: "[email protected]" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
26 changes: 26 additions & 0 deletions
26
spec/models/policies/early_years_payments/admin_tasks_presenter_spec.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
require "rails_helper" | ||
|
||
RSpec.describe Policies::EarlyYearsPayments::AdminTasksPresenter do | ||
describe "#employment" do | ||
let(:claim) { | ||
create(:claim, | ||
:submitted, | ||
policy: Policies::EarlyYearsPayments, | ||
eligibility_attributes: { | ||
nursery_urn: eligible_ey_provider.urn, | ||
start_date: Date.new(2018, 1, 1) | ||
}) | ||
} | ||
let(:eligible_ey_provider) { create(:eligible_ey_provider) } | ||
|
||
subject { described_class.new(claim).employment } | ||
|
||
it "shows current employment" do | ||
expect(subject[0][1]).to eq claim.eligibility.eligible_ey_provider.nursery_name | ||
end | ||
|
||
it "shows start date" do | ||
expect(subject[1][1]).to eq "1 January 2018" | ||
end | ||
end | ||
end |
35 changes: 35 additions & 0 deletions
35
spec/models/policies/early_years_payments/eligibility_spec.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# frozen_string_literal: true | ||
|
||
require "rails_helper" | ||
|
||
RSpec.describe Policies::EarlyYearsPayments::Eligibility do | ||
let(:eligibility) { build(:early_years_payments_eligibility, :eligible) } | ||
|
||
describe "#employment_task_available_at" do | ||
subject { eligibility.employment_task_available_at } | ||
|
||
it { is_expected.to eq eligibility.start_date + 6.months } | ||
end | ||
|
||
describe "#employment_task_available?" do | ||
subject { eligibility.employment_task_available? } | ||
|
||
context "before 6 months from start date" do | ||
before { travel_to eligibility.start_date } | ||
|
||
it { is_expected.to be false } | ||
end | ||
|
||
context "exactly 6 months from start date" do | ||
before { travel_to eligibility.start_date + 6.months } | ||
|
||
it { is_expected.to be true } | ||
end | ||
|
||
context "after 6 months from start date" do | ||
before { travel_to eligibility.start_date + 6.months + 1.day } | ||
|
||
it { is_expected.to be true } | ||
end | ||
end | ||
end |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters