Skip to content

Commit

Permalink
Add spec for disallowed filter combination results
Browse files Browse the repository at this point in the history
  • Loading branch information
pixeldesu committed Jan 25, 2024
1 parent b96651f commit 3b46c2c
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions spec/controllers/inbox_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,37 @@
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

Expand Down

0 comments on commit 3b46c2c

Please sign in to comment.