Set visible to only_through_links on enterprise creation

This commit is contained in:
Jean-Baptiste Bellet
2023-07-25 10:52:30 +02:00
parent 5a0d4d2a93
commit d22566aa50
2 changed files with 9 additions and 1 deletions

View File

@@ -74,7 +74,7 @@ module Api
end
def override_visible
enterprise_params[:visible] = false
enterprise_params[:visible] = "only_through_links"
end
def enterprise_params

View File

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