Browse Source

CLDC-3558 Display correct orgs data protection confirmation (#2511)

* Display correct orgs data protection confirmation

* Remove binding
pull/2502/head^2
kosiakkatrina 6 months ago committed by GitHub
parent
commit
e639c5c861
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 2
      app/controllers/organisations_controller.rb
  2. 19
      spec/requests/organisations_controller_spec.rb

2
app/controllers/organisations_controller.rb

@ -238,7 +238,7 @@ class OrganisationsController < ApplicationController
end
def data_sharing_agreement
@data_protection_confirmation = current_user.organisation.data_protection_confirmation
@data_protection_confirmation = @organisation.data_protection_confirmation
end
def confirm_data_sharing_agreement

19
spec/requests/organisations_controller_spec.rb

@ -2099,6 +2099,25 @@ RSpec.describe OrganisationsController, type: :request do
expect(response).to have_http_status(:ok)
end
end
context "when signed in as support" do
let(:support_user) { create(:user, :support, with_dsa: false) }
before do
organisation.data_protection_confirmation.update!(signed_at: Time.zone.local(2001, 3, 2), organisation_name: "Org name")
allow(support_user).to receive(:need_two_factor_authentication?).and_return(false)
sign_in support_user
end
context "and viewing other org dsa" do
it "shows correct org data and dates" do
get "/organisations/#{organisation.id}/data-sharing-agreement", headers: headers
expect(response).to have_http_status(:ok)
expect(page).to have_content("This agreement is made the 2nd day of March 2001")
expect(page).to have_content("1) Org name")
end
end
end
end
describe "POST #data_sharing_agreement" do

Loading…
Cancel
Save