diff --git a/app/views/admin/enterprises/_admin_index.html.haml b/app/views/admin/enterprises/_admin_index.html.haml index cb38f57722..f065a8c507 100644 --- a/app/views/admin/enterprises/_admin_index.html.haml +++ b/app/views/admin/enterprises/_admin_index.html.haml @@ -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"} diff --git a/spec/system/admin/enterprises/index_spec.rb b/spec/system/admin/enterprises/index_spec.rb index 019ca733a2..751e8df2f7 100644 --- a/spec/system/admin/enterprises/index_spec.rb +++ b/spec/system/admin/enterprises/index_spec.rb @@ -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