mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-27 01:43:22 +00:00
Since #9087, we don't use a boolean but an enum, 'public' or 'hidden'
This commit is contained in:
@@ -29,7 +29,7 @@
|
||||
= t('.producer')
|
||||
- if spree_current_user.admin?
|
||||
%td= enterprise_form.select :sells, Enterprise::SELLS, {}, class: 'select2 fullwidth'
|
||||
%td= enterprise_form.check_box :visible
|
||||
%td= enterprise_form.check_box :visible, {}, 'public', 'hidden'
|
||||
- if spree_current_user.admin?
|
||||
%td= enterprise_form.select :owner_id, enterprise.users.map{ |e| [ e.email, e.id ] }, {}, class: "select2 fullwidth"
|
||||
%td{"data-hook" => "admin_users_index_row_actions"}
|
||||
|
||||
@@ -35,7 +35,7 @@ describe 'Enterprises Index' do
|
||||
end
|
||||
|
||||
context "editing enterprises in bulk" do
|
||||
let!(:s){ create(:supplier_enterprise) }
|
||||
let!(:s){ create(:supplier_enterprise, visible: true) }
|
||||
let!(:d){ create(:distributor_enterprise, sells: 'none') }
|
||||
let!(:d_manager) { create(:user, enterprise_limit: 1) }
|
||||
|
||||
@@ -59,7 +59,7 @@ describe 'Enterprises Index' do
|
||||
click_button "Update"
|
||||
expect(flash_message).to eq('Enterprises updated successfully')
|
||||
distributor = Enterprise.find(d.id)
|
||||
expect(distributor.visible).to eq false
|
||||
expect(distributor.visible).to eq "hidden"
|
||||
expect(distributor.sells).to eq 'any'
|
||||
expect(distributor.owner).to eq d_manager
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user