Add spec for disallowed filter combination results

This commit is contained in:
Andreas Nedbal 2024-01-25 21:49:15 +01:00 committed by Andreas Nedbal
parent b96651fa70
commit 3b46c2c7e9
1 changed files with 31 additions and 0 deletions

View File

@ -254,6 +254,37 @@ describe InboxController, type: :controller do
end end
end end
end end
context "when passed the anonymous and the author param" do
let!(:other_user) { FactoryBot.create(:user) }
let!(:generic_inbox_entry) do
Inbox.create(
user:,
question: FactoryBot.create(
:question,
user: other_user,
author_is_anonymous: false,
),
)
end
let!(:inbox_entry_fillers) do
# 9 times => 1 entry less than default page size
9.times.map { Inbox.create(user:, question: FactoryBot.create(:question, author_is_anonymous: true)) }
end
subject { get :show, params: { anonymous: true, author: "some_name" } }
include_examples "sets the expected ivars" do
let(:expected_assigns) do
{
inbox: [],
more_data_available: false,
inbox_count: 0,
}
end
end
end
end end
end end