Skip to content

Commit 46a569b

Browse files
Remove adjustment creation in AuditsController#finalize and update corresponding test (#5319)
1 parent ef51085 commit 46a569b

File tree

2 files changed

+1
-5
lines changed

2 files changed

+1
-5
lines changed

app/controllers/audits_controller.rb

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,6 @@ def edit
2121
end
2222

2323
def finalize
24-
@audit.adjustment = Adjustment.new(organization_id: @audit.organization_id, storage_location_id: @audit.storage_location_id, user_id: current_user.id, comment: 'Created Automatically through the Auditing Process')
25-
@audit.save
26-
2724
AuditEvent.publish(@audit)
2825
@audit.finalized!
2926
redirect_to audit_path(@audit), notice: "Audit is Finalized."

spec/system/audit_system_spec.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@
276276
end
277277

278278
describe "Finalizing an audit" do
279-
it "creates an adjustment with the differential" do
279+
it "updates inventory based on audit" do
280280
item_quantity = 10
281281

282282
visit subject
@@ -288,7 +288,6 @@
288288
end
289289
expect(page).to have_content("Audit is Finalized.")
290290
end.to change { storage_location.size }.by(quantity - item_quantity)
291-
expect(Adjustment.last.comment == "Created Automatically through the Auditing Process").to be_truthy
292291
end
293292

294293
it "is immutable" do

0 commit comments

Comments
 (0)