Skip to content

Commit

Permalink
Update course_results_spec test
Browse files Browse the repository at this point in the history
  • Loading branch information
gms-gs committed Nov 18, 2024
1 parent fc54cd3 commit 5e21504
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 22 deletions.
4 changes: 2 additions & 2 deletions app/components/find/courses/summary_component/view.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@
<% if course.salaried? %>
This course pays a <strong>salary</strong>.
<% if course.apprenticeship? %>
It is a Teaching Apprenticeship.
It is a teaching apprenticeship.
<% end %>
<br>
<span class="govuk-hint govuk-!-font-size-16">There is no fee.</span>
<% elsif course.apprenticeship? %>
This is a Teaching Apprenticeship course that pays a <strong>salary</strong>.
This is a teaching apprenticeship course that pays a <strong>salary</strong>.
<span class="govuk-hint govuk-!-font-size-16">There is no fee.</span>
<% else %>
<%= course.course_fee_content %>
Expand Down
4 changes: 2 additions & 2 deletions app/components/find/results/search_result_component.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@
<% if course.salaried? %>
This course pays a <strong>salary</strong>.
<% if course.apprenticeship? %>
It is a Teaching Apprenticeship.
It is a teaching apprenticeship.
<% end %>
<br>
<span class="govuk-hint govuk-!-font-size-16">There is no fee.</span>
<% elsif course.apprenticeship? %>
This is a Teaching Apprenticeship course that pays a <strong>salary</strong>.
This is a teaching apprenticeship course that pays a <strong>salary</strong>.
<span class="govuk-hint govuk-!-font-size-16">There is no fee.</span>
<% else %>
<%= course.course_fee_content %>
Expand Down
7 changes: 4 additions & 3 deletions spec/components/find/courses/sumary_component/view_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ module SummaryComponent

result = render_inline(described_class.new(course))
expect(result.text).to include(
'Fee or salary',
'Course fee',
'Course length',
'Age range',
Expand All @@ -29,7 +28,9 @@ module SummaryComponent

result = render_inline(described_class.new(course))
expect(result.text).not_to include('£9,250')
expect(result.text).not_to include('Course fee')
expect(result.text).to include('Course fee')
expect(result.text).to include("This course pays a salary.")
expect(result.text).to include("It is a teaching apprenticeship.")
end
end

Expand Down Expand Up @@ -185,7 +186,7 @@ module SummaryComponent

expect(result.text).not_to include('for UK citizens')
expect(result.text).not_to include('£14,000 for Non-UK citizens')
expect(result.text).not_to include('Course fee')
expect(result.text).to include('Course fee')
end
end
end
Expand Down
16 changes: 2 additions & 14 deletions spec/components/find/results/search_result_component_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -92,18 +92,6 @@ module Find
end
end

context 'when there is an accrediting provider' do
it 'renders correct message' do
course = build(
:course,
accrediting_provider: build(:provider, :accredited_provider, provider_name: 'ACME SCITT A1')
)
result = render_inline(described_class.new(course:, results_view:))

expect(result.text).to include('QTS ratified by ACME SCITT A1')
end
end

context 'when there is no accrediting provider' do
it 'renders correct message' do
course = build(
Expand All @@ -122,7 +110,7 @@ module Find

result = render_inline(described_class.new(course:, results_view:))
expect(result.text).not_to include('£9,250')
expect(result.text).not_to include('Course fee')
expect(result.text).to include('Course fee')
end
end

Expand Down Expand Up @@ -175,7 +163,7 @@ module Find

expect(result.text).not_to include('for UK citizens')
expect(result.text).not_to include('£14,000 for Non-UK citizens')
expect(result.text).not_to include('Course fee')
expect(result.text).to include('Course fee')
end
end

Expand Down
2 changes: 1 addition & 1 deletion spec/features/find/search/course_results_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def i_see_the_courses
expect(first_course.provider_name.text).to be_present
expect(first_course).to have_text('QTS with PGCE')
expect(first_course).to have_text('1 year - full time')
expect(first_course).to have_text('Teaching apprenticeship - with salary')
expect(first_course).to have_text('This course pays a salary')
end
end

Expand Down

0 comments on commit 5e21504

Please sign in to comment.