From 0799ff7a36bd89c995a9e93230736b69a9bb8391 Mon Sep 17 00:00:00 2001 From: kosiakkatrina <54268893+kosiakkatrina@users.noreply.github.com> Date: Fri, 25 Oct 2024 08:20:07 +0100 Subject: [PATCH 1/3] CLDC-3658 Extract household needs copy (#2718) * Extract household needs subsection copy * Extract housing needs soft validations copy * Add new lines at the end of some files --- .../sales/pages/household_wheelchair_check.rb | 4 +-- .../form/sales/questions/armed_forces.rb | 3 -- .../sales/questions/armed_forces_spouse.rb | 2 -- .../sales/questions/buyer_still_serving.rb | 2 -- .../sales/questions/household_disability.rb | 3 -- .../sales/questions/household_wheelchair.rb | 2 -- .../questions/household_wheelchair_check.rb | 3 +- config/locales/en.yml | 2 -- .../forms/2023/sales/household_needs.en.yml | 34 +++++++++++++++++++ .../forms/2023/sales/soft_validations.en.yml | 6 ++++ .../forms/2024/sales/household_needs.en.yml | 34 +++++++++++++++++++ .../forms/2024/sales/soft_validations.en.yml | 6 ++++ .../pages/household_wheelchair_check_spec.rb | 3 +- .../sales/subsections/household_needs_spec.rb | 3 +- 14 files changed, 87 insertions(+), 20 deletions(-) create mode 100644 config/locales/forms/2023/sales/household_needs.en.yml create mode 100644 config/locales/forms/2024/sales/household_needs.en.yml diff --git a/app/models/form/sales/pages/household_wheelchair_check.rb b/app/models/form/sales/pages/household_wheelchair_check.rb index 72b78cc2b..8cd2821be 100644 --- a/app/models/form/sales/pages/household_wheelchair_check.rb +++ b/app/models/form/sales/pages/household_wheelchair_check.rb @@ -6,8 +6,8 @@ class Form::Sales::Pages::HouseholdWheelchairCheck < ::Form::Page "wheelchair_when_not_disabled?" => true, }, ] - @informative_text = {} - @title_text = { "translation" => "soft_validations.wheelchair.title_text" } + @copy_key = "sales.soft_validations.wheel_value_check" + @title_text = { "translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text" } end def questions diff --git a/app/models/form/sales/questions/armed_forces.rb b/app/models/form/sales/questions/armed_forces.rb index 0d655a733..7bd14d7b1 100644 --- a/app/models/form/sales/questions/armed_forces.rb +++ b/app/models/form/sales/questions/armed_forces.rb @@ -2,10 +2,7 @@ class Form::Sales::Questions::ArmedForces < ::Form::Question def initialize(id, hsh, page) super @id = "hhregres" - @check_answer_label = "Have any of the buyers ever served as a regular in the UK armed forces?" - @header = "Have any of the buyers ever served as a regular in the UK armed forces?" @type = "radio" - @hint_text = "A regular is somebody who has served in the Royal Navy, the Royal Marines, the Royal Airforce or Army full time and does not include reserve forces" @answer_options = ANSWER_OPTIONS @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] end diff --git a/app/models/form/sales/questions/armed_forces_spouse.rb b/app/models/form/sales/questions/armed_forces_spouse.rb index 949b5d612..02be7c5e3 100644 --- a/app/models/form/sales/questions/armed_forces_spouse.rb +++ b/app/models/form/sales/questions/armed_forces_spouse.rb @@ -2,8 +2,6 @@ class Form::Sales::Questions::ArmedForcesSpouse < ::Form::Question def initialize(id, hsh, page) super @id = "armedforcesspouse" - @check_answer_label = "Are any of the buyers a spouse or civil partner of a UK armed forces regular who died in service within the last 2 years?" - @header = "Are any of the buyers a spouse or civil partner of a UK armed forces regular who died in service within the last 2 years?" @type = "radio" @answer_options = ANSWER_OPTIONS @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] diff --git a/app/models/form/sales/questions/buyer_still_serving.rb b/app/models/form/sales/questions/buyer_still_serving.rb index 602a0804d..04c1c2307 100644 --- a/app/models/form/sales/questions/buyer_still_serving.rb +++ b/app/models/form/sales/questions/buyer_still_serving.rb @@ -2,8 +2,6 @@ class Form::Sales::Questions::BuyerStillServing < ::Form::Question def initialize(id, hsh, page) super @id = "hhregresstill" - @check_answer_label = "Are they still serving in the UK armed forces?" - @header = "Is the buyer still serving in the UK armed forces?" @type = "radio" @answer_options = ANSWER_OPTIONS @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] diff --git a/app/models/form/sales/questions/household_disability.rb b/app/models/form/sales/questions/household_disability.rb index 43773dcf3..3dac19bb6 100644 --- a/app/models/form/sales/questions/household_disability.rb +++ b/app/models/form/sales/questions/household_disability.rb @@ -2,11 +2,8 @@ class Form::Sales::Questions::HouseholdDisability < ::Form::Question def initialize(id, hsh, page) super @id = "disabled" - @header = "Does anyone in the household consider themselves to have a disability?" - @check_answer_label = "Does anyone in the household have a disability?" @type = "radio" @answer_options = ANSWER_OPTIONS - @hint_text = "This includes any long-term health condition that has an impact on the person's day-to-day life" @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] end diff --git a/app/models/form/sales/questions/household_wheelchair.rb b/app/models/form/sales/questions/household_wheelchair.rb index 4b5316b29..4c46bd55d 100644 --- a/app/models/form/sales/questions/household_wheelchair.rb +++ b/app/models/form/sales/questions/household_wheelchair.rb @@ -2,10 +2,8 @@ class Form::Sales::Questions::HouseholdWheelchair < ::Form::Question def initialize(id, hsh, page) super @id = "wheel" - @header = "Does anyone in the household use a wheelchair?" @type = "radio" @answer_options = ANSWER_OPTIONS - @hint_text = "This can be inside or outside the home" @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] end diff --git a/app/models/form/sales/questions/household_wheelchair_check.rb b/app/models/form/sales/questions/household_wheelchair_check.rb index 50498b099..a37e80203 100644 --- a/app/models/form/sales/questions/household_wheelchair_check.rb +++ b/app/models/form/sales/questions/household_wheelchair_check.rb @@ -2,8 +2,7 @@ class Form::Sales::Questions::HouseholdWheelchairCheck < ::Form::Question def initialize(id, hsh, page) super @id = "wheel_value_check" - @check_answer_label = "Does anyone in the household use a wheelchair?" - @header = "You told us that someone in the household uses a wheelchair." + @copy_key = "sales.soft_validations.wheel_value_check" @type = "interruption_screen" @answer_options = { "0" => { "value" => "Yes" }, diff --git a/config/locales/en.yml b/config/locales/en.yml index faced2c11..53154eab2 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -754,8 +754,6 @@ Make sure these answers are correct." grant: title_text: "You told us that the grant amount is %{grant}." hint_text: "Loans, grants and subsidies are usually between £9,000 and £16,000." - wheelchair: - title_text: "You told us that someone in the household uses a wheelchair." referral: title_text: "Are you sure?" hint_text: "This is a general needs log, and this referral type is for supported housing." diff --git a/config/locales/forms/2023/sales/household_needs.en.yml b/config/locales/forms/2023/sales/household_needs.en.yml new file mode 100644 index 000000000..f4a13e47a --- /dev/null +++ b/config/locales/forms/2023/sales/household_needs.en.yml @@ -0,0 +1,34 @@ +en: + forms: + 2023: + sales: + household_needs: + hhregres: + page_header: "" + check_answer_label: "Have any of the buyers ever served as a regular in the UK armed forces?" + hint_text: "A regular is somebody who has served in the Royal Navy, the Royal Marines, the Royal Airforce or Army full time and does not include reserve forces" + question_text: "Have any of the buyers ever served as a regular in the UK armed forces?" + + hhregresstill: + page_header: "" + check_answer_label: "Are they still serving in the UK armed forces?" + hint_text: "" + question_text: "Is the buyer still serving in the UK armed forces?" + + armedforcesspouse: + page_header: "" + check_answer_label: "Are any of the buyers a spouse or civil partner of a UK armed forces regular who died in service within the last 2 years?" + hint_text: "" + question_text: "Are any of the buyers a spouse or civil partner of a UK armed forces regular who died in service within the last 2 years?" + + disabled: + page_header: "" + check_answer_label: "Does anyone in the household have a disability?" + hint_text: "This includes any long-term health condition that has an impact on the person's day-to-day life" + question_text: "Does anyone in the household consider themselves to have a disability?" + + wheel: + page_header: "" + check_answer_label: "Does anyone in the household use a wheelchair?" + hint_text: "This can be inside or outside the home" + question_text: "Does anyone in the household use a wheelchair?" diff --git a/config/locales/forms/2023/sales/soft_validations.en.yml b/config/locales/forms/2023/sales/soft_validations.en.yml index de5138208..a0912555a 100644 --- a/config/locales/forms/2023/sales/soft_validations.en.yml +++ b/config/locales/forms/2023/sales/soft_validations.en.yml @@ -58,3 +58,9 @@ en: not_joint_purchase: title_text: "You told us the buyer’s deposit was %{deposit} and their savings were %{savings}." informative_text: "The deposit amount is higher than we would expect for the amount of savings they have." + wheel_value_check: + page_header: "" + check_answer_label: "Does anyone in the household use a wheelchair?" + hint_text: "" + question_text: "You told us that someone in the household uses a wheelchair." + title_text: "You told us that someone in the household uses a wheelchair." diff --git a/config/locales/forms/2024/sales/household_needs.en.yml b/config/locales/forms/2024/sales/household_needs.en.yml new file mode 100644 index 000000000..290543a34 --- /dev/null +++ b/config/locales/forms/2024/sales/household_needs.en.yml @@ -0,0 +1,34 @@ +en: + forms: + 2024: + sales: + household_needs: + hhregres: + page_header: "" + check_answer_label: "Have any of the buyers ever served as a regular in the UK armed forces?" + hint_text: "A regular is somebody who has served in the Royal Navy, the Royal Marines, the Royal Airforce or Army full time and does not include reserve forces" + question_text: "Have any of the buyers ever served as a regular in the UK armed forces?" + + hhregresstill: + page_header: "" + check_answer_label: "Are they still serving in the UK armed forces?" + hint_text: "" + question_text: "Is the buyer still serving in the UK armed forces?" + + armedforcesspouse: + page_header: "" + check_answer_label: "Are any of the buyers a spouse or civil partner of a UK armed forces regular who died in service within the last 2 years?" + hint_text: "" + question_text: "Are any of the buyers a spouse or civil partner of a UK armed forces regular who died in service within the last 2 years?" + + disabled: + page_header: "" + check_answer_label: "Does anyone in the household have a disability?" + hint_text: "This includes any long-term health condition that has an impact on the person's day-to-day life" + question_text: "Does anyone in the household consider themselves to have a disability?" + + wheel: + page_header: "" + check_answer_label: "Does anyone in the household use a wheelchair?" + hint_text: "This can be inside or outside the home" + question_text: "Does anyone in the household use a wheelchair?" diff --git a/config/locales/forms/2024/sales/soft_validations.en.yml b/config/locales/forms/2024/sales/soft_validations.en.yml index 853d21ad2..2c7ac6e3e 100644 --- a/config/locales/forms/2024/sales/soft_validations.en.yml +++ b/config/locales/forms/2024/sales/soft_validations.en.yml @@ -58,3 +58,9 @@ en: not_joint_purchase: title_text: "You told us the buyer’s deposit was %{deposit} and their savings were %{savings}." informative_text: "The deposit amount is higher than we would expect for the amount of savings they have." + wheel_value_check: + page_header: "" + check_answer_label: "Does anyone in the household use a wheelchair?" + hint_text: "" + question_text: "You told us that someone in the household uses a wheelchair." + title_text: "You told us that someone in the household uses a wheelchair." diff --git a/spec/models/form/sales/pages/household_wheelchair_check_spec.rb b/spec/models/form/sales/pages/household_wheelchair_check_spec.rb index f0789b54c..68e269cbf 100644 --- a/spec/models/form/sales/pages/household_wheelchair_check_spec.rb +++ b/spec/models/form/sales/pages/household_wheelchair_check_spec.rb @@ -5,7 +5,8 @@ RSpec.describe Form::Sales::Pages::HouseholdWheelchairCheck, type: :model do let(:page_id) { "buyer_1_income_mortgage_value_check" } let(:page_definition) { nil } - let(:subsection) { instance_double(Form::Subsection) } + let(:form) { instance_double(Form, start_date: Time.zone.local(2024, 4, 1)) } + let(:subsection) { instance_double(Form::Subsection, form:) } it "has correct subsection" do expect(page.subsection).to eq(subsection) diff --git a/spec/models/form/sales/subsections/household_needs_spec.rb b/spec/models/form/sales/subsections/household_needs_spec.rb index d65f5513e..cd4ff67fa 100644 --- a/spec/models/form/sales/subsections/household_needs_spec.rb +++ b/spec/models/form/sales/subsections/household_needs_spec.rb @@ -5,7 +5,8 @@ RSpec.describe Form::Sales::Subsections::HouseholdNeeds, type: :model do let(:subsection_id) { nil } let(:subsection_definition) { nil } - let(:section) { instance_double(Form::Sales::Sections::Household) } + let(:form) { instance_double(Form, start_date: Time.zone.local(2024, 4, 1)) } + let(:section) { instance_double(Form::Sales::Sections::Household, form:) } it "has correct section" do expect(household_characteristics.section).to eq(section) From 72d83bcd44ac37384ed99c5fb9c00b17a3923b41 Mon Sep 17 00:00:00 2001 From: kosiakkatrina <54268893+kosiakkatrina@users.noreply.github.com> Date: Fri, 25 Oct 2024 13:15:45 +0100 Subject: [PATCH 2/3] Fix role updates (#2727) * Allow some providers to update role on staging * Refactor --- app/controllers/users_controller.rb | 17 ++++++++++------- app/models/user.rb | 6 +++++- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index b7c323ca1..f27bfc2b3 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -257,13 +257,7 @@ private def user_params if @user == current_user - if current_user.data_coordinator? - params.require(:user).permit(:email, :phone, :phone_extension, :name, :password, :password_confirmation, :role, :is_dpo, :is_key_contact, :initial_confirmation_sent) - elsif current_user.support? - params.require(:user).permit(:email, :phone, :phone_extension, :name, :password, :password_confirmation, :role, :is_dpo, :is_key_contact, :initial_confirmation_sent, :organisation_id) - else - params.require(:user).permit(:email, :phone, :phone_extension, :name, :password, :password_confirmation, :initial_confirmation_sent) - end + current_user_params elsif current_user.data_coordinator? params.require(:user).permit(:email, :phone, :phone_extension, :name, :role, :is_dpo, :is_key_contact, :active, :initial_confirmation_sent) elsif current_user.support? @@ -271,6 +265,15 @@ private end end + def current_user_params + base_params = %i[email phone phone_extension name password password_confirmation initial_confirmation_sent] + return params.require(:user).permit(*(base_params + %i[role is_dpo is_key_contact])) if current_user.data_coordinator? + return params.require(:user).permit(*(base_params + %i[role is_dpo is_key_contact organisation_id])) if current_user.support? + return params.require(:user).permit(*(base_params + [:role])) if Rails.env.staging? && current_user.in_staging_role_update_email_allowlist? + + params.require(:user).permit(*base_params) + end + def user_params_without_org user_params.except(:organisation_id) end diff --git a/app/models/user.rb b/app/models/user.rb index 0d3bc4846..75b5a366b 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -212,7 +212,7 @@ class User < ApplicationRecord end def assignable_roles - if Rails.env.staging? && Rails.application.credentials[:staging_role_update_email_allowlist].include?(email.split("@").last.downcase) + if Rails.env.staging? && in_staging_role_update_email_allowlist? return ROLES end @@ -222,6 +222,10 @@ class User < ApplicationRecord ROLES.except(:support) end + def in_staging_role_update_email_allowlist? + Rails.application.credentials[:staging_role_update_email_allowlist].include?(email.split("@").last.downcase) + end + def logs_filters(specific_org: false) if (support? && !specific_org) || organisation.has_managing_agents? || organisation.has_stock_owners? %w[years status needstypes assigned_to user owning_organisation managing_organisation bulk_upload_id user_text_search owning_organisation_text_search managing_organisation_text_search] From be52a7b7b49c79cb60e682464062a7050f74e55d Mon Sep 17 00:00:00 2001 From: kosiakkatrina <54268893+kosiakkatrina@users.noreply.github.com> Date: Fri, 25 Oct 2024 15:17:19 +0100 Subject: [PATCH 3/3] CLDC-2639 Display correct back to logs button (#2721) * Display correct back to logs button * Add bulk_upload_filter_applied for sales * Update view tests --- app/controllers/lettings_logs_controller.rb | 2 +- app/controllers/sales_logs_controller.rb | 2 +- app/helpers/log_actions_helper.rb | 8 +++--- app/services/storage/local_disk_service.rb | 4 ++- app/views/logs/edit.html.erb | 2 +- .../requests/lettings_logs_controller_spec.rb | 25 ++++++++++++++++++ spec/views/logs/edit.html.erb_spec.rb | 26 ++++++++++--------- 7 files changed, 49 insertions(+), 20 deletions(-) diff --git a/app/controllers/lettings_logs_controller.rb b/app/controllers/lettings_logs_controller.rb index 0194946d4..cc3c731d5 100644 --- a/app/controllers/lettings_logs_controller.rb +++ b/app/controllers/lettings_logs_controller.rb @@ -65,7 +65,7 @@ class LettingsLogsController < LogsController elsif @log.collection_closed_for_editing? redirect_to review_lettings_log_path(@log) else - render("logs/edit", locals: { current_user: }) + render("logs/edit", locals: { current_user:, bulk_upload_filter_applied: session_filters["bulk_upload_id"].present? }) end end diff --git a/app/controllers/sales_logs_controller.rb b/app/controllers/sales_logs_controller.rb index d1bbe3bc2..af9879896 100644 --- a/app/controllers/sales_logs_controller.rb +++ b/app/controllers/sales_logs_controller.rb @@ -39,7 +39,7 @@ class SalesLogsController < LogsController if @log.collection_closed_for_editing? redirect_to review_sales_log_path(@log, sales_log: true) else - render "logs/edit", locals: { current_user: } + render "logs/edit", locals: { current_user:, bulk_upload_filter_applied: session_filters["bulk_upload_id"].present? } end end diff --git a/app/helpers/log_actions_helper.rb b/app/helpers/log_actions_helper.rb index 8a018445e..3f2737cdd 100644 --- a/app/helpers/log_actions_helper.rb +++ b/app/helpers/log_actions_helper.rb @@ -2,8 +2,8 @@ module LogActionsHelper include GovukLinkHelper include GovukVisuallyHiddenHelper - def edit_actions_for_log(log) - back = back_button_for(log) + def edit_actions_for_log(log, bulk_upload_filter_applied) + back = back_button_for(log, bulk_upload_filter_applied) delete = delete_button_for_log(log) return if back.nil? && delete.nil? @@ -15,9 +15,9 @@ module LogActionsHelper private - def back_button_for(log) + def back_button_for(log, bulk_upload_filter_applied) if log.completed? - if log.creation_method_bulk_upload? && log.bulk_upload.present? + if log.creation_method_bulk_upload? && log.bulk_upload.present? && bulk_upload_filter_applied if log.lettings? govuk_button_link_to "Back to uploaded logs", resume_bulk_upload_lettings_result_path(log.bulk_upload) else diff --git a/app/services/storage/local_disk_service.rb b/app/services/storage/local_disk_service.rb index 228f0339e..8e69e2516 100644 --- a/app/services/storage/local_disk_service.rb +++ b/app/services/storage/local_disk_service.rb @@ -19,7 +19,9 @@ module Storage File.open(path, "r") end - def write_file(filename, data, _content_type: nil) + # rubocop:disable Lint/UnusedMethodArgument + def write_file(filename, data, content_type: nil) + # rubocop:enable Lint/UnusedMethodArgument path = Rails.root.join("tmp/storage", filename) FileUtils.mkdir_p(path.dirname) diff --git a/app/views/logs/edit.html.erb b/app/views/logs/edit.html.erb index 68bf78e87..3859ca6db 100644 --- a/app/views/logs/edit.html.erb +++ b/app/views/logs/edit.html.erb @@ -38,6 +38,6 @@ <%= render "tasklist" %> - <%= edit_actions_for_log(@log) %> + <%= edit_actions_for_log(@log, bulk_upload_filter_applied) %> diff --git a/spec/requests/lettings_logs_controller_spec.rb b/spec/requests/lettings_logs_controller_spec.rb index 79a184336..3443a70ca 100644 --- a/spec/requests/lettings_logs_controller_spec.rb +++ b/spec/requests/lettings_logs_controller_spec.rb @@ -1158,6 +1158,31 @@ RSpec.describe LettingsLogsController, type: :request do expect(page).to have_link("review and make changes to this log", href: "/lettings-logs/#{lettings_log.id}/review") end end + + context "with bulk_upload_id filter" do + let(:bulk_upload) { create(:bulk_upload, :lettings, user:) } + let(:lettings_log) { create(:lettings_log, :completed, age1: nil, bulk_upload:, assigned_to: user, creation_method: "bulk upload") } + + before do + lettings_log.status = "completed" + lettings_log.skip_update_status = true + lettings_log.save!(validate: false) + end + + context "with bulk_upload_id filter in session" do + it "displays back to uploaded logs link" do + get "/lettings-logs/#{lettings_log.id}?bulk_upload_id[]=#{bulk_upload.id}" + expect(page).to have_link("Back to uploaded logs") + end + end + + context "without bulk_upload_id filter in session" do + it "does not display back to uploaded logs link" do + get "/lettings-logs/#{lettings_log.id}" + expect(page).not_to have_link("Back to uploaded logs") + end + end + end end context "with lettings logs from a closed collection period before the previous collection" do diff --git a/spec/views/logs/edit.html.erb_spec.rb b/spec/views/logs/edit.html.erb_spec.rb index 9ecb1e5c8..b2dde0f3d 100644 --- a/spec/views/logs/edit.html.erb_spec.rb +++ b/spec/views/logs/edit.html.erb_spec.rb @@ -1,11 +1,13 @@ require "rails_helper" RSpec.describe "logs/edit.html.erb" do + let(:current_user) { create(:user, :support) } + before do Timecop.freeze(Time.zone.local(2024, 3, 1)) Singleton.__init__(FormHandler) assign(:log, log) - sign_in create(:user, :support) + sign_in current_user end after do @@ -17,7 +19,7 @@ RSpec.describe "logs/edit.html.erb" do let(:log) { create(:lettings_log, :in_progress) } it "there is no link back to log type root" do - render + render template: "logs/edit", locals: { current_user:, bulk_upload_filter_applied: false } fragment = Capybara::Node::Simple.new(rendered) @@ -25,7 +27,7 @@ RSpec.describe "logs/edit.html.erb" do end it "has link 'Delete log'" do - render + render template: "logs/edit", locals: { current_user:, bulk_upload_filter_applied: false } fragment = Capybara::Node::Simple.new(rendered) @@ -38,7 +40,7 @@ RSpec.describe "logs/edit.html.erb" do let(:log) { create(:lettings_log, :completed) } it "has link 'Back to lettings logs'" do - render + render template: "logs/edit", locals: { current_user:, bulk_upload_filter_applied: false } fragment = Capybara::Node::Simple.new(rendered) @@ -46,7 +48,7 @@ RSpec.describe "logs/edit.html.erb" do end it "has link 'Delete log'" do - render + render template: "logs/edit", locals: { current_user:, bulk_upload_filter_applied: false } fragment = Capybara::Node::Simple.new(rendered) @@ -58,7 +60,7 @@ RSpec.describe "logs/edit.html.erb" do let(:log) { create(:sales_log, :completed) } it "has link 'Back to sales logs'" do - render + render template: "logs/edit", locals: { current_user:, bulk_upload_filter_applied: false } fragment = Capybara::Node::Simple.new(rendered) @@ -66,7 +68,7 @@ RSpec.describe "logs/edit.html.erb" do end it "has link 'Delete log'" do - render + render template: "logs/edit", locals: { current_user:, bulk_upload_filter_applied: false } fragment = Capybara::Node::Simple.new(rendered) @@ -79,7 +81,7 @@ RSpec.describe "logs/edit.html.erb" do let(:log) { create(:lettings_log, :completed, bulk_upload:, creation_method: "bulk upload") } it "has link 'Back to uploaded logs'" do - render + render template: "logs/edit", locals: { current_user:, bulk_upload_filter_applied: true } fragment = Capybara::Node::Simple.new(rendered) @@ -87,7 +89,7 @@ RSpec.describe "logs/edit.html.erb" do end it "has link 'Delete log'" do - render + render template: "logs/edit", locals: { current_user:, bulk_upload_filter_applied: true } fragment = Capybara::Node::Simple.new(rendered) @@ -99,7 +101,7 @@ RSpec.describe "logs/edit.html.erb" do let(:log) { create(:lettings_log, :completed, bulk_upload: nil, creation_method: "bulk upload") } it "does not have link 'Back to uploaded logs'" do - render + render template: "logs/edit", locals: { current_user:, bulk_upload_filter_applied: false } fragment = Capybara::Node::Simple.new(rendered) @@ -112,7 +114,7 @@ RSpec.describe "logs/edit.html.erb" do let(:log) { create(:sales_log, :completed, bulk_upload:, creation_method: "bulk upload") } it "has link 'Back to uploaded logs'" do - render + render template: "logs/edit", locals: { current_user:, bulk_upload_filter_applied: true } fragment = Capybara::Node::Simple.new(rendered) @@ -120,7 +122,7 @@ RSpec.describe "logs/edit.html.erb" do end it "has link 'Delete log'" do - render + render template: "logs/edit", locals: { current_user:, bulk_upload_filter_applied: true } fragment = Capybara::Node::Simple.new(rendered)