-
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 #3021 from DFE-Digital/fe-award-amount
[LUPEYALPHA-653] FE award amount
- Loading branch information
Showing
7 changed files
with
76 additions
and
2 deletions.
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
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
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
51 changes: 51 additions & 0 deletions
51
spec/models/journeys/further_education_payments/session_answers_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,51 @@ | ||
require "rails_helper" | ||
|
||
RSpec.describe Journeys::FurtherEducationPayments::SessionAnswers do | ||
subject { described_class.new(answers.attributes) } | ||
|
||
let(:school) { create(:school, :further_education, :fe_eligible) } | ||
|
||
describe "#award_amount" do | ||
context "when teaching over 12 hours per week" do | ||
let(:answers) do | ||
build( | ||
:further_education_payments_answers, | ||
school_id: school.id, | ||
teaching_hours_per_week: "more_than_12" | ||
) | ||
end | ||
|
||
it "returns max award amount" do | ||
expect(subject.award_amount).to eql(school.eligible_fe_provider.max_award_amount) | ||
end | ||
end | ||
|
||
context "when teaching between 2.5 and 12 hours per week" do | ||
let(:answers) do | ||
build( | ||
:further_education_payments_answers, | ||
school_id: school.id, | ||
teaching_hours_per_week: "between_2_5_and_12" | ||
) | ||
end | ||
|
||
it "returns lower award amount" do | ||
expect(subject.award_amount).to eql(school.eligible_fe_provider.lower_award_amount) | ||
end | ||
end | ||
|
||
context "when teaching less than 2.5 hours per week" do | ||
let(:answers) do | ||
build( | ||
:further_education_payments_answers, | ||
school_id: school.id, | ||
teaching_hours_per_week: "less_than_2_5" | ||
) | ||
end | ||
|
||
it "returns zero" do | ||
expect(subject.award_amount).to be_zero | ||
end | ||
end | ||
end | ||
end |