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

Add spec covering pending induction submission status #57

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/services/teachers/induction_status.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ class Teachers::InductionStatus
def initialize(teacher:, induction_periods:, trs_induction_status:)
@teacher = teacher
@induction_periods = induction_periods
@trs_induction_status = trs_induction_status || teacher&.trs_induction_status
@trs_induction_status = trs_induction_status
end

def status_tag_kwargs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,18 @@
expect(view.content_for(:backlink_or_breadcrumb)).to have_link('Back', href: '/appropriate-body/claim-an-ect/find-ect/new')
end

describe 'induction status' do
let(:pending_induction_submission) { FactoryBot.create(:pending_induction_submission, trs_induction_status: 'FailedInWales') }

it 'displays the status tag that corresponds to the TRS induction status on the pending induction submission' do
assign(:pending_induction_submission, pending_induction_submission)

render

expect(rendered).to have_css('strong.govuk-tag', text: 'Failed in Wales')
end
end

describe 'induction periods' do
let(:teacher) { FactoryBot.create(:teacher) }
let(:pending_induction_submission) { FactoryBot.create(:pending_induction_submission) }
Expand Down
Loading