summaryrefslogtreecommitdiff
path: root/spec/support/shared_examples/models/atomic_internal_id_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/support/shared_examples/models/atomic_internal_id_spec.rb')
-rw-r--r--spec/support/shared_examples/models/atomic_internal_id_spec.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/spec/support/shared_examples/models/atomic_internal_id_spec.rb b/spec/support/shared_examples/models/atomic_internal_id_spec.rb
index ac1cfa47def..dce2622172b 100644
--- a/spec/support/shared_examples/models/atomic_internal_id_spec.rb
+++ b/spec/support/shared_examples/models/atomic_internal_id_spec.rb
@@ -1,7 +1,7 @@
require 'spec_helper'
shared_examples_for 'AtomicInternalId' do
- let(:validate_presence) { true }
+ let(:allow_nil) { false }
describe '.has_internal_id' do
describe 'Module inclusion' do
@@ -18,7 +18,11 @@ shared_examples_for 'AtomicInternalId' do
it 'validates presence' do
instance.valid?
- expect(instance.errors[:iid]).to include("can't be blank") if validate_presence
+ if allow_nil
+ expect(instance.errors[:iid]).to be_empty
+ else
+ expect(instance.errors[:iid]).to include("can't be blank")
+ end
end
end