mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-12 03:50:22 +00:00
Repair specs
This commit is contained in:
committed by
Rachel Arnould
parent
657df9eb8f
commit
3c7c02da2f
@@ -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')
|
||||
|
||||
Reference in New Issue
Block a user