Browse Source

more tests passing

pull/787/head
JG 3 years ago
parent
commit
63f2ac3367
  1. 13
      app/views/users/edit.html.erb
  2. 5
      spec/features/user_spec.rb

13
app/views/users/edit.html.erb

@ -30,19 +30,6 @@
:id,
:name,
legend: { text: "Role", size: "m" } %>
<%= f.govuk_collection_radio_buttons :is_dpo,
[OpenStruct.new(id: true, name: "Yes"), OpenStruct.new(id: false, name: "No")],
:id,
:name,
legend: { text: "#{perspective(@user, current_user)} the organisation’s data protection officer?", size: "m" } %>
<%= f.govuk_collection_radio_buttons :is_key_contact,
[OpenStruct.new(id: true, name: "Yes"), OpenStruct.new(id: false, name: "No")],
:id,
:name,
legend: { text: "#{perspective(@user, current_user)} a key contact for this service?", size: "m" },
hint: { text: "This is a person responsible for sharing information about social housing lettings and sales data within the organisation." } %>
<% end %>
<%= f.govuk_submit "Save changes" %>

5
spec/features/user_spec.rb

@ -355,17 +355,12 @@ RSpec.describe "User Features" do
click_link(other_user.name)
expect(page).to have_title("Other name’s account")
first(:link, "Change").click
expect(page).to have_field("user[is_dpo]", with: true)
choose("user-is-dpo-field")
choose("user-is-key-contact-true-field")
fill_in("user[name]", with: "Updated new name")
click_button("Save changes")
expect(page).to have_title("Updated new name’s account")
expect(User.find_by(
name: "Updated new name",
role: "data_provider",
is_dpo: false,
is_key_contact: true,
)).to be_a(User)
end
end

Loading…
Cancel
Save