From a58b50ea97856f7bd2295f2a76c0ea00b62340f2 Mon Sep 17 00:00:00 2001 From: davidtrussler Date: Wed, 4 Sep 2024 19:17:46 +0100 Subject: [PATCH] Update root_controller_test for new UI --- test/functional/root_controller_test.rb | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/test/functional/root_controller_test.rb b/test/functional/root_controller_test.rb index 52a0a8eb4..3e5d5e858 100644 --- a/test/functional/root_controller_test.rb +++ b/test/functional/root_controller_test.rb @@ -33,11 +33,11 @@ class RootControllerTest < ActionController::TestCase assert_select "p.publications-table__heading", "1 document(s)" end - should "filter publications by format" do + should "filter publications by content type" do FactoryBot.create(:guide_edition) FactoryBot.create(:completed_transaction_edition) - get :index, params: { format_filter: "guide" } + get :index, params: { content_type_filter: "guide" } assert_response :ok assert_select "p.publications-table__heading", "1 document(s)" @@ -57,7 +57,14 @@ class RootControllerTest < ActionController::TestCase FilteredEditionsPresenter .expects(:new) .with(has_entry(:states_filter, %w[draft])) - .returns(stub(editions: Kaminari.paginate_array([]).page(1), available_users: [])) + .returns(stub( + editions: Kaminari.paginate_array([]).page(1), + available_users: [], + title: "", + assignees: [], + content_types: [], + edition_states: [], + )) get :index, params: { states_filter: %w[draft not_a_real_state] } end