Skip to content

Commit

Permalink
Update root_controller_test for new UI
Browse files Browse the repository at this point in the history
  • Loading branch information
davidtrussler committed Sep 5, 2024
1 parent b23a112 commit a58b50e
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions test/functional/root_controller_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)"
Expand All @@ -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
Expand Down

0 comments on commit a58b50e

Please sign in to comment.