mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-01 02:03:22 +00:00
Set visible to only_through_links on enterprise registration
This commit is contained in:
@@ -92,7 +92,7 @@ module Admin
|
||||
return render :welcome, layout: "spree/layouts/bare_admin"
|
||||
end
|
||||
|
||||
attributes = { sells: register_params[:sells], visible: true }
|
||||
attributes = { sells: register_params[:sells], visible: "only_through_links" }
|
||||
|
||||
if @enterprise.update(attributes)
|
||||
flash[:success] = I18n.t(:enterprise_register_success_notice, enterprise: @enterprise.name)
|
||||
|
||||
@@ -453,6 +453,11 @@ describe Admin::EnterprisesController, type: :controller do
|
||||
expect(flash[:error]).to eq "Please select a package"
|
||||
end
|
||||
end
|
||||
|
||||
it "set visibility to 'only_through_links' by default" do
|
||||
spree_post :register, id: enterprise, sells: 'none'
|
||||
expect(enterprise.reload.visible).to eq 'only_through_links'
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user