diff --git a/app/helpers/data_sharing_agreement_helper.rb b/app/helpers/data_sharing_agreement_helper.rb index 662f1b30b..d2e2e074d 100644 --- a/app/helpers/data_sharing_agreement_helper.rb +++ b/app/helpers/data_sharing_agreement_helper.rb @@ -75,7 +75,7 @@ private return "Not accepted" unless organisation.data_protection_confirmed? if user.support? - "Accepted #{organisation.data_protection_confirmation.created_at.strftime('%d/%m/%Y')}" + "Accepted #{organisation.data_protection_confirmation.signed_at.strftime('%d/%m/%Y')}" else "Accepted" end diff --git a/db/seeds.rb b/db/seeds.rb index 94d36a7fb..3631e2c07 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -12,6 +12,9 @@ def create_data_protection_confirmation(user) organisation: user.organisation, confirmed: true, data_protection_officer: user, + signed_at: Time.zone.local(2019, 1, 1), + data_protection_officer_email: user.email, + data_protection_officer_name: user.name, ) end diff --git a/spec/factories/data_protection_confirmation.rb b/spec/factories/data_protection_confirmation.rb index 24ef504df..5295e3a52 100644 --- a/spec/factories/data_protection_confirmation.rb +++ b/spec/factories/data_protection_confirmation.rb @@ -15,6 +15,6 @@ FactoryBot.define do created_at { Time.zone.now } updated_at { Time.zone.now } - signed_at { Time.zone.now } + signed_at { Time.zone.local(2022, 2, 4) } end end diff --git a/spec/views/organisations/show.html.erb_spec.rb b/spec/views/organisations/show.html.erb_spec.rb index 142097c27..119462349 100644 --- a/spec/views/organisations/show.html.erb_spec.rb +++ b/spec/views/organisations/show.html.erb_spec.rb @@ -98,7 +98,7 @@ RSpec.describe "organisations/show.html.erb" do it "shows data sharing agreement accepted with date" do render - expect(fragment).to have_content("Accepted 10/01/2023") + expect(fragment).to have_content("Accepted 04/02/2022") end it "shows show name of who signed the agreement" do