From 6d6aa591779a6f87c567d11ff8403eb54c18d630 Mon Sep 17 00:00:00 2001 From: Iain McNulty Date: Tue, 14 May 2024 17:56:57 +0100 Subject: [PATCH] Rename reporting_date to reporting_end_date --- .../publications/provider_recruitment_performance_report.rb | 2 +- app/views/provider_interface/reports/index.html.erb | 2 +- .../provider_recruitment_performance_report_spec.rb | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/models/publications/provider_recruitment_performance_report.rb b/app/models/publications/provider_recruitment_performance_report.rb index 9f1ea675297..286e2731e0c 100644 --- a/app/models/publications/provider_recruitment_performance_report.rb +++ b/app/models/publications/provider_recruitment_performance_report.rb @@ -3,7 +3,7 @@ class ProviderRecruitmentPerformanceReport < ApplicationRecord belongs_to :provider validates :cycle_week, :publication_date, presence: true - def reporting_date + def reporting_end_date CycleTimetable.cycle_week_date_range(cycle_week).last.to_date end end diff --git a/app/views/provider_interface/reports/index.html.erb b/app/views/provider_interface/reports/index.html.erb index c5affec69d5..827d05ad35c 100644 --- a/app/views/provider_interface/reports/index.html.erb +++ b/app/views/provider_interface/reports/index.html.erb @@ -19,7 +19,7 @@ <% end %> <% report = provider.performance_reports.last %> <% end %> <% else %> diff --git a/spec/models/publications/provider_recruitment_performance_report_spec.rb b/spec/models/publications/provider_recruitment_performance_report_spec.rb index ecd1e678dea..3fdd884a5e0 100644 --- a/spec/models/publications/provider_recruitment_performance_report_spec.rb +++ b/spec/models/publications/provider_recruitment_performance_report_spec.rb @@ -10,10 +10,10 @@ it { is_expected.to validate_presence_of :cycle_week } end - describe '#reporting_date' do + describe '#reporting_end_date' do it 'returns the date of the last day of the cycle week', time: Time.zone.local(2024, 6, 6) do report = create(:provider_recruitment_performance_report, cycle_week: 35) - expect(report.reporting_date).to eq(Date.new(2024, 6, 2)) + expect(report.reporting_end_date).to eq(Date.new(2024, 6, 2)) end end end