From effd646e5462319f4a06eca5e229cffad06a46dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Sun, 19 Sep 2021 00:09:18 +0200 Subject: [PATCH] Update the way we create form builders in tests We were getting a warning in Rails 6: DEPRECATION WARNING: ActionView::Base instances should be constructed with a lookup context, assignments, and a controller. --- spec/components/sdg/related_list_selector_component_spec.rb | 2 +- spec/lib/consul_form_builder_spec.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/spec/components/sdg/related_list_selector_component_spec.rb b/spec/components/sdg/related_list_selector_component_spec.rb index f06280fa0..07f5893b1 100644 --- a/spec/components/sdg/related_list_selector_component_spec.rb +++ b/spec/components/sdg/related_list_selector_component_spec.rb @@ -2,7 +2,7 @@ require "rails_helper" describe SDG::RelatedListSelectorComponent do let(:debate) { create(:debate) } - let(:form) { ConsulFormBuilder.new(:debate, debate, ActionView::Base.new, {}) } + let(:form) { ConsulFormBuilder.new(:debate, debate, ApplicationController.new.view_context, {}) } let(:component) { SDG::RelatedListSelectorComponent.new(form) } before do diff --git a/spec/lib/consul_form_builder_spec.rb b/spec/lib/consul_form_builder_spec.rb index ed73b6b62..a61e984da 100644 --- a/spec/lib/consul_form_builder_spec.rb +++ b/spec/lib/consul_form_builder_spec.rb @@ -11,7 +11,7 @@ describe ConsulFormBuilder do stub_const("DummyModel::OPTIONS", %w[Good Bad Ugly].freeze) end - let(:builder) { ConsulFormBuilder.new(:dummy, DummyModel.new, ActionView::Base.new, {}) } + let(:builder) { ConsulFormBuilder.new(:dummy, DummyModel.new, ApplicationController.new.view_context, {}) } describe "hints" do it "does not generate hints by default" do