mirror of
https://github.com/Retrospring/retrospring.git
synced 2025-03-28 00:51:48 +01:00
Add tests for user-tracked anonymous blocks
This commit is contained in:
parent
97736a956d
commit
6df07bb377
1 changed files with 15 additions and 0 deletions
|
@ -99,6 +99,20 @@ describe UseCase::Question::Create do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
shared_examples "filters signed in questions" do
|
||||||
|
context "user blocks this anonymized user" do
|
||||||
|
before do
|
||||||
|
target_user.anonymous_blocks.create!(
|
||||||
|
identifier: "r4nd0m",
|
||||||
|
question_id: FactoryBot.create(:question).id,
|
||||||
|
target_user_id: source_user&.id
|
||||||
|
)
|
||||||
|
end
|
||||||
|
|
||||||
|
it_behaves_like "creates the question", false
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
context "user signed in" do
|
context "user signed in" do
|
||||||
let!(:source_user) { FactoryBot.create(:user) }
|
let!(:source_user) { FactoryBot.create(:user) }
|
||||||
|
|
||||||
|
@ -115,6 +129,7 @@ describe UseCase::Question::Create do
|
||||||
|
|
||||||
context "recipient allows anonymous questions" do
|
context "recipient allows anonymous questions" do
|
||||||
it_behaves_like "filters questions"
|
it_behaves_like "filters questions"
|
||||||
|
it_behaves_like "filters signed in questions"
|
||||||
it_behaves_like "creates the question"
|
it_behaves_like "creates the question"
|
||||||
it_behaves_like "validates content"
|
it_behaves_like "validates content"
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue