Introduce Contact#deletable?

This commit is contained in:
Artur Beljajev 2019-06-21 18:01:56 +03:00
parent d14fa5b701
commit 7c768616a2
4 changed files with 31 additions and 20 deletions

View file

@ -44,6 +44,16 @@ class ContactTest < ActiveSupport::TestCase
assert_not contact.managed_by?(user)
end
def test_deletable_when_not_linked
contact = unlinked_contact
assert contact.deletable?
end
def test_undeletable_when_linked
assert @contact.linked?
assert_not @contact.deletable?
end
private
def unlinked_contact