Sha256: 8a0de5a0873fea43a3cf1e5e3f22033165c5097c404f3a521f59aaf244526788
Contents?: true
Size: 822 Bytes
Versions: 62
Compression:
Stored size: 822 Bytes
Contents
require 'test_helper' module Workarea module Navigation class SortNavigationMenusByOrdersTest < TestCase def test_sorting_by_sales menu_one = create_menu(position: 1) menu_two = create_menu(position: 2) menu_three = create_menu(position: 3) menu_four = create_menu(position: 4) Metrics::MenuByDay.inc(key: { menu_id: menu_one.id }, orders: 1) Metrics::MenuByDay.inc(key: { menu_id: menu_two.id }, orders: 2) Metrics::MenuByDay.inc(key: { menu_id: menu_three.id }, orders: 3) SortNavigationMenusByOrders.perform assert_equal(0, menu_three.reload.position) assert_equal(1, menu_two.reload.position) assert_equal(2, menu_one.reload.position) assert(menu_four.reload.position.present?) end end end end
Version data entries
62 entries across 62 versions & 1 rubygems