FIX: don't allow blocked user to send emails in

This commit is contained in:
Régis Hanol
2016-02-11 10:39:57 +01:00
parent 5120dcfb3d
commit cad7fc1062
6 changed files with 28 additions and 3 deletions

View File

@ -43,6 +43,11 @@ describe Email::Receiver do
expect { process(:inactive_sender) }.to raise_error(Email::Receiver::InactiveUserError)
end
it "raises a BlockedUserError when the sender has been blocked" do
Fabricate(:user, email: "blocked@bar.com", blocked: true)
expect { process(:blocked_sender) }.to raise_error(Email::Receiver::BlockedUserError)
end
skip "doesn't raise an InactiveUserError when the sender is staged" do
Fabricate(:user, email: "staged@bar.com", active: false, staged: true)
expect { process(:staged_sender) }.not_to raise_error