diff options
Diffstat (limited to 'spec/support/shared_examples/work_item_hierarchy_restrictions_importer.rb')
-rw-r--r-- | spec/support/shared_examples/work_item_hierarchy_restrictions_importer.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/spec/support/shared_examples/work_item_hierarchy_restrictions_importer.rb b/spec/support/shared_examples/work_item_hierarchy_restrictions_importer.rb index d61458db3b3..0545be7c741 100644 --- a/spec/support/shared_examples/work_item_hierarchy_restrictions_importer.rb +++ b/spec/support/shared_examples/work_item_hierarchy_restrictions_importer.rb @@ -56,4 +56,19 @@ RSpec.shared_examples 'work item hierarchy restrictions importer' do expect(WorkItems::HierarchyRestriction.count).to eq(7) end end + + context 'when restrictions contain attributes not present in the table' do + before do + allow(WorkItems::HierarchyRestriction) + .to receive(:column_names).and_return(%w[parent_type_id child_type_id]) + end + + it 'filters out missing columns' do + expect(WorkItems::HierarchyRestriction).to receive(:upsert_all) do |args| + expect(args[0].keys).to eq(%i[parent_type_id child_type_id]) + end + + subject + end + end end |