From 2ac92e716363575fd32ae6b5b6b3bb61eefc3e81 Mon Sep 17 00:00:00 2001 From: Fabio Vilela Date: Tue, 3 Sep 2024 16:32:34 +1000 Subject: [PATCH] cater for Organization field being marked for deletion --- spec/live/organization_field_spec.rb | 2 +- spec/macros/resource_macros.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/spec/live/organization_field_spec.rb b/spec/live/organization_field_spec.rb index 165811ac..7a8f8d01 100644 --- a/spec/live/organization_field_spec.rb +++ b/spec/live/organization_field_spec.rb @@ -8,5 +8,5 @@ def valid_attributes it_should_be_creatable it_should_be_updatable :title, "key" it_should_be_readable :organization_fields, :create => true - it_should_be_deletable + it_should_be_deletable :marked_for_deletion => true end diff --git a/spec/macros/resource_macros.rb b/spec/macros/resource_macros.rb index 652f9463..9a6564ab 100644 --- a/spec/macros/resource_macros.rb +++ b/spec/macros/resource_macros.rb @@ -110,7 +110,7 @@ def it_should_be_deletable(options = {}) if options[:find] expect(obj.send(options[:find].first)).to eq(options[:find].last) else - expect(obj.nil? || !obj.active?).to eq(true) + options[:marked_for_deletion] ? (expect(obj.active?).to be_falsey) : (expect(obj).to be_nil) end end end