Browse Source

Add registration number field

pull/636/head
baarkerlounger 3 years ago
parent
commit
ed8bf0fbc1
  1. 2
      app/controllers/organisations_controller.rb
  2. 4
      app/views/organisations/new.html.erb
  3. 2
      spec/requests/organisations_controller_spec.rb

2
app/controllers/organisations_controller.rb

@ -88,7 +88,7 @@ class OrganisationsController < ApplicationController
private private
def org_params def org_params
params.require(:organisation).permit(:name, :address_line1, :address_line2, :postcode, :phone, :holds_own_stock, :provider_type) params.require(:organisation).permit(:name, :address_line1, :address_line2, :postcode, :phone, :holds_own_stock, :provider_type, :housing_registration_no)
end end
def search_term def search_term

4
app/views/organisations/new.html.erb

@ -38,6 +38,10 @@
autocomplete: "tel", autocomplete: "tel",
width: 20 %> width: 20 %>
<%= f.govuk_text_field :housing_registration_no,
label: { text: "Regulator of Social Housing registration number", size: "m" },
width: 10 %>
<% null_option = [OpenStruct.new(id: "", name: "Select an option")] %> <% null_option = [OpenStruct.new(id: "", name: "Select an option")] %>
<% types = Organisation::PROVIDER_TYPE.map { |key, _val| OpenStruct.new(id: key, name: Organisation::DISPLAY_PROVIDER_TYPE[key]) } %> <% types = Organisation::PROVIDER_TYPE.map { |key, _val| OpenStruct.new(id: key, name: Organisation::DISPLAY_PROVIDER_TYPE[key]) } %>
<% type_answer_options = null_option + types %> <% type_answer_options = null_option + types %>

2
spec/requests/organisations_controller_spec.rb

@ -282,6 +282,7 @@ RSpec.describe OrganisationsController, type: :request do
phone: "011101101", phone: "011101101",
provider_type: "LA", provider_type: "LA",
holds_own_stock: "true", holds_own_stock: "true",
housing_registration_no: "7917937"
}, },
} }
end end
@ -853,6 +854,7 @@ RSpec.describe OrganisationsController, type: :request do
phone: "011101101", phone: "011101101",
provider_type: "LA", provider_type: "LA",
holds_own_stock: "true", holds_own_stock: "true",
housing_registration_no: "7917937"
}, },
} }
end end

Loading…
Cancel
Save