-
Notifications
You must be signed in to change notification settings - Fork 94
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make sure submitters entity is never redacted
- Loading branch information
1 parent
10681a7
commit 80db3b8
Showing
3 changed files
with
40 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -84,6 +84,38 @@ | |
expect(entity).to receive(:force_redactions) | ||
entity.save | ||
end | ||
|
||
context 'redaction of submitter entities' do | ||
it "doesn't redact entities linked to users with submitter role" do | ||
params = { name: 'Test if we redact' } | ||
entity = Entity.new(params) | ||
entity.save | ||
|
||
create(:user, :submitter, entity: entity) | ||
|
||
entity.name = 'Test if we redact [email protected]' | ||
entity.save | ||
|
||
expect(entity.name).to include '[email protected]' | ||
end | ||
|
||
it "doesn't redact entities linked to users with submitter role using GoogleSenderRedactor" do | ||
params = { name: 'Test if we redact' } | ||
entity = Entity.new(params) | ||
entity.save | ||
|
||
create(:user, :submitter, entity: entity) | ||
|
||
notice = create(:defamation, :with_facet_data) | ||
notice.entity_notice_roles = notice.entity_notice_roles.select { |entity_role| entity_role.name.to_sym != :sender } | ||
notice.entity_notice_roles << create(:entity_notice_role, entity: entity, name: 'sender') | ||
notice.recipient.name = 'Google' | ||
notice.auto_redact | ||
notice.recipient.save | ||
|
||
expect(notice.sender.name).not_to eq Lumen::REDACTION_MASK | ||
end | ||
end | ||
end | ||
|
||
context 'validating scoped name attribute' do | ||
|