Skip to content

Commit

Permalink
Add PromotionBatches menu item
Browse files Browse the repository at this point in the history
  • Loading branch information
tomdonarski committed Dec 4, 2023
1 parent 23ae618 commit 6b57a51
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ def build
add_integrations_section(root)
add_oauth_section(root)
add_settings_section(root)
add_promotion_batches_section(root)
root
end

Expand Down Expand Up @@ -255,6 +256,13 @@ def add_settings_section(root)
build
root.add(section)
end

def add_promotion_batches_section(root)
root.add(ItemBuilder.new('promotion_batches', admin_promotion_batches_path).
with_icon_key('stack.svg').
with_admin_ability_check(Spree::PromotionBatch).
build)
end
# rubocop:enable Metrics/AbcSize
end
# rubocop:enable Metrics/ClassLength
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ module Admin
subject { builder.build }

it 'builds a valid menu' do
expect(subject.items.count).to eq(12)
expect(subject.items.count).to eq(13)
expect(subject.items.map(&:key)).to include('dashboard')
expect(subject.items.map(&:key)).to include('orders')
expect(subject.items.map(&:key)).to include('settings')
Expand Down

0 comments on commit 6b57a51

Please sign in to comment.