Since #9087, we don't use a boolean but an enum, 'public' or 'hidden'

This commit is contained in:
Jean-Baptiste Bellet
2022-09-16 10:02:27 +02:00
parent 3942c4d808
commit 4a8dc37b40
2 changed files with 3 additions and 3 deletions

View File

@@ -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"}

View File

@@ -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