Browse Source

revert mistaken copy changes in designs

pull/2389/head
Arthur Campbell 2 years ago
parent
commit
878b66f283
  1. 2
      app/helpers/data_sharing_agreement_helper.rb
  2. 4
      app/helpers/organisations_helper.rb
  3. 2
      app/views/organisations/show.html.erb
  4. 6
      spec/helpers/organisations_helper_spec.rb
  5. 12
      spec/views/organisations/show.html.erb_spec.rb

2
app/helpers/data_sharing_agreement_helper.rb

@ -1,7 +1,7 @@
module DataSharingAgreementHelper
def data_sharing_agreement_row(user:, organisation:, summary_list:)
summary_list.with_row do |row|
row.with_key { "Data protection agreement" }
row.with_key { "Data Sharing Agreement" }
row.with_action(
href: data_sharing_agreement_organisation_path(organisation),
text: "View agreement",

4
app/helpers/organisations_helper.rb

@ -16,9 +16,9 @@ module OrganisationsHelper
{ name: "Telephone number", value: organisation.phone, editable: true },
{ name: "Registration number", value: organisation.housing_registration_no || "", editable: false },
{ name: "Type of provider", value: organisation.display_provider_type, editable: false },
{ name: "Owns housing stock?", value: organisation.holds_own_stock ? "Yes" : "No", editable: false },
{ name: "Owns housing stock", value: organisation.holds_own_stock ? "Yes" : "No", editable: false },
{ name: "Rent periods", value: organisation.rent_period_labels, editable: true, format: :bullet },
{ name: "Data protection agreement" },
{ name: "Data Sharing Agreement" },
{ name: "Status", value: status_tag(organisation.status), editable: false },
]
end

2
app/views/organisations/show.html.erb

@ -16,7 +16,7 @@
<%= govuk_summary_list do |summary_list| %>
<%= organisation_name_row(user: current_user, organisation: @organisation, summary_list:) %>
<% display_organisation_attributes(@organisation).each do |attr| %>
<% if attr[:name] == "Data protection agreement" %>
<% if attr[:name] == "Data Sharing Agreement" %>
<%= data_sharing_agreement_row(organisation: @organisation, user: current_user, summary_list:) %>
<% else %>
<% if can_edit_org?(current_user) && attr[:editable] %>

6
spec/helpers/organisations_helper_spec.rb

@ -5,7 +5,7 @@ RSpec.describe OrganisationsHelper do
describe "display_organisation_attributes" do
let(:organisation) { create(:organisation) }
it "does not include data protection agreement" do
it "has the correct values" do
expect(display_organisation_attributes(organisation)).to eq(
[{ editable: false, name: "Organisation ID", value: "ORG#{organisation.id}" },
{ editable: true,
@ -14,9 +14,9 @@ RSpec.describe OrganisationsHelper do
{ editable: true, name: "Telephone number", value: nil },
{ editable: false, name: "Registration number", value: "1234" },
{ editable: false, name: "Type of provider", value: "Local authority" },
{ editable: false, name: "Owns housing stock?", value: "Yes" },
{ editable: false, name: "Owns housing stock", value: "Yes" },
{ editable: true, format: :bullet, name: "Rent periods", value: [] },
{ name: "Data protection agreement" },
{ name: "Data Sharing Agreement" },
{ editable: false, name: "Status", value: status_tag(organisation.status) }],
)
end

12
spec/views/organisations/show.html.erb_spec.rb

@ -16,7 +16,7 @@ RSpec.describe "organisations/show.html.erb" do
it "includes data sharing agreement row" do
render
expect(fragment).to have_content("Data protection agreement")
expect(fragment).to have_content("Data Sharing Agreement")
end
it "shows data sharing agreement not accepted" do
@ -37,7 +37,7 @@ RSpec.describe "organisations/show.html.erb" do
it "includes data sharing agreement row" do
render
expect(fragment).to have_content("Data protection agreement")
expect(fragment).to have_content("Data Sharing Agreement")
end
it "shows data sharing agreement accepted" do
@ -60,7 +60,7 @@ RSpec.describe "organisations/show.html.erb" do
it "includes data sharing agreement row" do
render
expect(fragment).to have_content("Data protection agreement")
expect(fragment).to have_content("Data Sharing Agreement")
end
it "shows data sharing agreement not accepted" do
@ -87,7 +87,7 @@ RSpec.describe "organisations/show.html.erb" do
it "includes data sharing agreement row" do
render
expect(fragment).to have_content("Data protection agreement")
expect(fragment).to have_content("Data Sharing Agreement")
end
it "shows data sharing agreement accepted with date" do
@ -130,7 +130,7 @@ RSpec.describe "organisations/show.html.erb" do
it "includes data sharing agreement row" do
render
expect(fragment).to have_content("Data protection agreement")
expect(fragment).to have_content("Data Sharing Agreement")
end
it "shows data sharing agreement not accepted" do
@ -154,7 +154,7 @@ RSpec.describe "organisations/show.html.erb" do
it "includes data sharing agreement row" do
render
expect(fragment).to have_content("Data protection agreement")
expect(fragment).to have_content("Data Sharing Agreement")
end
it "shows data sharing agreement accepted" do

Loading…
Cancel
Save