diff --git a/app/views/admin/enterprises/index.html.haml b/app/views/admin/enterprises/index.html.haml index 30dfc7a8f2..c8b3cce3d4 100644 --- a/app/views/admin/enterprises/index.html.haml +++ b/app/views/admin/enterprises/index.html.haml @@ -28,14 +28,11 @@ %tr{class: "enterprise-#{enterprise.id}"} %td= link_to enterprise.name, main_app.edit_admin_enterprise_path(enterprise) %td - - if enterprise.is_primary_producer && enterprise.is_distributor - Producer & Distributor - - elsif enterprise.is_distributor - Distributor - - elsif enterprise.is_primary_producer - Producer - - else - %h1.icon-exclamation-sign.with-tip{"data-powertip" => "This enterprise does not have any roles", style: "text-align: center;color: #DA5354"} + = enterprise_form.check_box :is_primary_producer + Producer + %br/ + = enterprise_form.check_box :is_distributor + Hub %td= enterprise_form.check_box :visible %td= enterprise_form.select :type, Enterprise::TYPES, {}, class: 'select2 fullwidth' %td{"data-hook" => "admin_users_index_row_actions"} diff --git a/spec/features/admin/enterprises_spec.rb b/spec/features/admin/enterprises_spec.rb index 00c15160f0..a824716d95 100644 --- a/spec/features/admin/enterprises_spec.rb +++ b/spec/features/admin/enterprises_spec.rb @@ -263,16 +263,20 @@ feature %q{ click_link "Enterprises" - within("tr.enterprise-#{supplier1.id}") do - expect(page).to have_content supplier1.name - expect(page).to have_select "enterprise_set_collection_attributes_1_type" - end - within("tr.enterprise-#{distributor1.id}") do expect(page).to have_content distributor1.name + expect(page).to have_checked_field "enterprise_set_collection_attributes_0_is_distributor" + expect(page).to have_unchecked_field "enterprise_set_collection_attributes_0_is_primary_producer" expect(page).to have_select "enterprise_set_collection_attributes_0_type" end + within("tr.enterprise-#{supplier1.id}") do + expect(page).to have_content supplier1.name + expect(page).to have_unchecked_field "enterprise_set_collection_attributes_1_is_distributor" + expect(page).to have_checked_field "enterprise_set_collection_attributes_1_is_primary_producer" + expect(page).to have_select "enterprise_set_collection_attributes_1_type" + end + expect(page).to_not have_content "supplier2.name" expect(page).to_not have_content "distributor2.name" end