Skip to content

Commit

Permalink
Appease Codecov with additional request spec case
Browse files Browse the repository at this point in the history
This should get us to 100% coverage for the StoreCreditsController!
  • Loading branch information
MadelineCollier committed Dec 12, 2024
1 parent 9639966 commit 72d357a
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions admin/spec/requests/solidus_admin/store_credits_spec.rb
Original file line number Diff line number Diff line change
@@ -58,6 +58,18 @@
follow_redirect!
expect(response.body).to include("Store credit was successfully updated.")
end

context "when update_amount fails" do
before do
allow_any_instance_of(Spree::StoreCredit).to receive(:update_amount).and_return(false)
end

it "renders the edit_amount template with errors" do
put solidus_admin.update_amount_user_store_credit_path(user, store_credit), params: { store_credit: valid_params }

expect(response).to have_http_status(:unprocessable_entity)
end
end
end

context "with invalid parameters" do

0 comments on commit 72d357a

Please sign in to comment.