Skip to content

Commit

Permalink
Merge pull request #83 from latera/HOMS-163
Browse files Browse the repository at this point in the history
HOMS-163 Fix filtering orders when filter by user name is not set
  • Loading branch information
Timofey Alekperov committed Feb 22, 2018
2 parents 0f83f73 + 5c985a0 commit f5673ab
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion config/locales/en.yml
Expand Up @@ -249,7 +249,7 @@ en:
'yes': Yes
not_selected: Not selected
select2:
not_set: Not set
not_set: Empty
user_not_found: Current user not found in Activiti

doc:
Expand Down
4 changes: 0 additions & 4 deletions lib/imprint/services/order_printing_service.rb
Expand Up @@ -18,10 +18,6 @@ class OrderPrintingService
optional(:filter).maybe(:str?)
optional(:user_id).maybe(:array?)

rule(filter_only: [:filter, :user_id]) do |filter, user_id|
filter.filled? > user_id.filled?
end

rule(order_type_for_custom_fields: [:order_type_id, :custom_fields]) do |order_type_id, custom_fields|
custom_fields.filled?.then(order_type_id.filled?)
end
Expand Down
5 changes: 5 additions & 0 deletions spec/features/orders/list_orders_spec.rb
Expand Up @@ -147,6 +147,11 @@
select2_cross('user_id[]', 'Empty').click
search_button.click
expect(empty_order_list).not_to eq(nil)

# Filter by user name isn't set
select2_cross('user_id[]', 'Christopher Johnson').click
search_button.click
expect(orders_list).to eq(current_orders_list)
end

scenario 'with filter by custom fields' do
Expand Down

0 comments on commit f5673ab

Please sign in to comment.