mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Set visible to only_through_links on enterprise creation
This commit is contained in:
@@ -74,7 +74,7 @@ module Api
|
||||
end
|
||||
|
||||
def override_visible
|
||||
enterprise_params[:visible] = false
|
||||
enterprise_params[:visible] = "only_through_links"
|
||||
end
|
||||
|
||||
def enterprise_params
|
||||
|
||||
@@ -37,6 +37,14 @@ describe Api::V0::EnterprisesController, type: :controller do
|
||||
expect(enterprise.sells).to eq('any')
|
||||
end
|
||||
|
||||
it "creates a visible=hidden enterprise" do
|
||||
api_post :create, { enterprise: new_enterprise_params }
|
||||
expect(response.status).to eq 201
|
||||
|
||||
enterprise = Enterprise.last
|
||||
expect(enterprise.visible).to eq("only_through_links")
|
||||
end
|
||||
|
||||
it "saves all user ids submitted" do
|
||||
manager1 = create(:user)
|
||||
manager2 = create(:user)
|
||||
|
||||
Reference in New Issue
Block a user