Skip to content

Commit

Permalink
Fix display of "inventory only" radio buttons
Browse files Browse the repository at this point in the history
Previously the two radio buttons were not showing which option was set; both options were blank even if one had been selected.
  • Loading branch information
Matt-Yorkley committed Sep 30, 2021
1 parent 5e658eb commit 76c9f38
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
.row
.alpha.eleven.columns
.five.columns.alpha
= radio_button :enterprise, :preferred_product_selection_from_inventory_only, "0", { 'ng-model' => 'Enterprise.preferred_product_selection_from_inventory_only' }
= radio_button :enterprise, :preferred_product_selection_from_inventory_only, false
= label :enterprise, :preferred_product_selection_from_inventory_only, t('.preferred_product_selection_from_inventory_only_yes')
.six.columns.omega
= radio_button :enterprise, :preferred_product_selection_from_inventory_only, "1", { 'ng-model' => 'Enterprise.preferred_product_selection_from_inventory_only' }
= radio_button :enterprise, :preferred_product_selection_from_inventory_only, true
= label :enterprise, :preferred_product_selection_from_inventory_only, t('.preferred_product_selection_from_inventory_only_no')
5 changes: 5 additions & 0 deletions spec/features/admin/enterprises_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,11 @@
choose "enterprise_preferred_shopfront_order_cycle_order_orders_open_at"
choose "enterprise_enable_subscriptions_true"

accept_alert do
click_link "Inventory Settings"
end
expect(page).to have_checked_field "enterprise_preferred_product_selection_from_inventory_only_false"

click_button 'Update'

expect(flash_message).to eq('Enterprise "Eaterprises" has been successfully updated!')
Expand Down

0 comments on commit 76c9f38

Please sign in to comment.