Repair specs

This commit is contained in:
François Turbelin
2024-11-28 23:18:10 +01:00
committed by Rachel Arnould
parent 657df9eb8f
commit 3c7c02da2f
5 changed files with 18 additions and 10 deletions

View File

@@ -8,7 +8,7 @@ RSpec.describe Api::V0::EnterprisesController, type: :controller do
let(:enterprise) { create(:distributor_enterprise) }
context "as an admin user" do
let(:admin) { create(:user) }
let(:admin) { create(:admin_user) }
let!(:enterprise) { create(:distributor_enterprise) }
before do
@@ -18,13 +18,12 @@ RSpec.describe Api::V0::EnterprisesController, type: :controller do
describe "updating an enterprise" do
let(:enterprise_params) do
{
enterprise_id: enterprise.id,
enterprise: { external_billing_id: 'INV123456' }
external_billing_id: 'INV123456'
}
end
it "creates a visible=hidden enterprise" do
api_post :create, enterprise_params
it "changes the external_billing_id field" do
api_put :update, id: enterprise.id, enterprise: enterprise_params
expect(response.status).to eq 200
expect(enterprise.reload.external_billing_id).to eq('INV123456')