Changing the way select filters are reset on BOM to try and fix specs

This commit is contained in:
Rob Harrington
2015-11-13 09:44:57 +11:00
parent 88fd9f72e6
commit 4191e2b6f0
2 changed files with 4 additions and 4 deletions

View File

@@ -29,9 +29,9 @@ angular.module("admin.lineItems").controller 'LineItemsCtrl', ($scope, $http, $q
LineItems.allSaved() || confirm("Unsaved changes exist and will be lost if you continue.")
$scope.resetSelectFilters = ->
$scope.distributorFilter = $scope.distributors[0].id
$scope.supplierFilter = $scope.suppliers[0].id
$scope.orderCycleFilter = $scope.orderCycles[0].id
$scope.distributorFilter = blankOption().id
$scope.supplierFilter = blankOption().id
$scope.orderCycleFilter = blankOption().id
$scope.quickSearch = ""
$scope.refreshData = ->

View File

@@ -283,7 +283,7 @@ feature %q{
it "displays a select box for order cycles, which filters line items by the selected order cycle", retry: 3 do
expect(page).to have_selector '#s2id_order_cycle_filter a.select2-choice', text: 'All'
expect(page).to have_select2 'order_cycle_filter', options: OrderCycle.order('orders_close_at DESC').pluck(:name).unshift("All")
expect(page).to have_select2 'order_cycle_filter', with_options: OrderCycle.pluck(:name).unshift("All")
expect(page).to have_selector "tr#li_#{li1.id}"
expect(page).to have_selector "tr#li_#{li2.id}"
select2_select oc1.name, from: "order_cycle_filter"