Add tests for user requirement in questions

This commit is contained in:
Andreas Nedbal 2022-11-13 14:28:24 +01:00
parent a705543d89
commit 93fcebe6c0
1 changed files with 13 additions and 0 deletions

View File

@ -175,6 +175,19 @@ describe UseCase::Question::Create do
it_behaves_like "invalid params" it_behaves_like "invalid params"
end end
end end
context "target user does not allow non-logged in questions" do
let(:allow_anon) { true }
let(:anonymous) { true }
let(:content) { "Hello world" }
let(:author_identifier) { "qwerty" }
before do
target_user.update!(privacy_require_user: true)
end
it_behaves_like "forbidden"
end
end end
end end
end end