Skip to content
This repository was archived by the owner on Jun 15, 2021. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/proofer/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def proofer
end

def blank?(val)
!val || val.empty?
!val || val.to_s.empty?
end
end
end
2 changes: 1 addition & 1 deletion lib/proofer/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module Proofer
VERSION = '2.7.1'.freeze
VERSION = '2.8.0'.freeze
end
10 changes: 9 additions & 1 deletion spec/lib/proofer/base_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ def hello(applicant, results)

describe '#validate_attributes' do
let(:required_attributes) { %i[first_name last_name] }
let(:optional_attributes) { %i[ssn] }
let(:optional_attributes) { %i[ssn some_boolean_feature] }

before do
impl.required_attributes(*required_attributes)
Expand Down Expand Up @@ -132,6 +132,14 @@ def hello(applicant, results)
expect { subject }.not_to raise_exception
end
end

context 'when optional attributes are booleans' do
let(:applicant) { { first_name: 'Homer', last_name: 'Simpson', some_boolean_feature: true } }

it 'does not raise' do
expect { subject }.not_to raise_exception
end
end
end

describe '#proof' do
Expand Down