Skip to content

Commit

Permalink
Add a multiline string pattern test
Browse files Browse the repository at this point in the history
  • Loading branch information
jmortlock committed Dec 20, 2016
1 parent 8e15a6a commit d092846
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions spec/sensitive_data/types/credit_card_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,12 @@ def validations(cards)
specify { expect(scan).to eq ['4111 1111 1111 1111'] }
end

context 'a value that contains valid credit cards in a multi line string' do
let(:value) { '@QUICKTRAVEL\n3782 822463 10005\nEXP: 07/20\n' }
specify { expect(scan).to eq ['3782 822463 10005'] }
specify { expect(mask).to eq '@QUICKTRAVEL\n[FILTERED]\nEXP: 07/20\n' }
end

context 'a value that does not contain valid credit card numbers' do
let(:value) { 'This text does not contain credit card values' }
specify { expect(scan).to be_empty }
Expand Down

0 comments on commit d092846

Please sign in to comment.