Commit 1f6453e4 authored by Gilang Gumilar's avatar Gilang Gumilar

Revert spec back to alphabetical order

parent 69985f11
...@@ -35,7 +35,7 @@ describe 'Group navbar' do ...@@ -35,7 +35,7 @@ describe 'Group navbar' do
before do before do
stub_licensed_features(cycle_analytics_for_groups: true) stub_licensed_features(cycle_analytics_for_groups: true)
insert_before_sub_nav_item( insert_after_sub_nav_item(
_('Contribution'), _('Contribution'),
within: _('Analytics'), within: _('Analytics'),
new_sub_nav_item_name: _('Value Stream') new_sub_nav_item_name: _('Value Stream')
......
...@@ -18,15 +18,4 @@ module NavbarStructureHelper ...@@ -18,15 +18,4 @@ module NavbarStructureHelper
index = hash[:nav_sub_items].find_index(before_sub_nav_item_name) index = hash[:nav_sub_items].find_index(before_sub_nav_item_name)
hash[:nav_sub_items].insert(index + 1, new_sub_nav_item_name) hash[:nav_sub_items].insert(index + 1, new_sub_nav_item_name)
end end
def insert_before_sub_nav_item(after_sub_nav_item_name, within:, new_sub_nav_item_name:)
expect(structure).to include(a_hash_including(nav_item: within))
hash = structure.find { |h| h[:nav_item] == within }
expect(hash).to have_key(:nav_sub_items)
expect(hash[:nav_sub_items]).to include(after_sub_nav_item_name)
index = hash[:nav_sub_items].find_index(after_sub_nav_item_name)
hash[:nav_sub_items].insert(index, new_sub_nav_item_name)
end
end end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment