Browse Source

CLDC-2695 Display signed at date instead of created at date for DSAs (#1941)

* Dislplay signed at date instead of created at date

* Add signed at and dpo details to DPC seed
pull/1946/head v0.3.61
kosiakkatrina 1 year ago committed by GitHub
parent
commit
29c01fa959
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      app/helpers/data_sharing_agreement_helper.rb
  2. 3
      db/seeds.rb
  3. 2
      spec/factories/data_protection_confirmation.rb
  4. 2
      spec/views/organisations/show.html.erb_spec.rb

2
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

3
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

2
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

2
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

Loading…
Cancel
Save