-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Set match_path on stock items MenuItem
Without setting match_path the tab helper uses the current controller name as criteria to activate the tab in the menu. Since the stock items controller can be accessed for a single product or all products we need to make sure it only matches the /stock_items path for the Stock menu tab. Closes #2950
- Loading branch information
Showing
2 changed files
with
23 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# frozen_string_literal: true | ||
|
||
require 'spec_helper' | ||
|
||
RSpec.describe Spree::BackendConfiguration do | ||
describe '#menu_items' do | ||
subject do | ||
described_class.new.menu_items | ||
end | ||
|
||
describe 'menu tab for stock items' do | ||
let(:stock_menu_item) do | ||
subject.detect { |item| item.label == :stock } | ||
end | ||
|
||
# Regression for https://github.com/solidusio/solidus/issues/2950 | ||
it 'has match_path set to /stock_items' do | ||
expect(stock_menu_item.match_path).to eq('/stock_items') | ||
end | ||
end | ||
end | ||
end |