Skip to content

Commit

Permalink
Fix return values for delete calls in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mcrumm authored and snewcomer committed Sep 6, 2018
1 parent dd03669 commit 41084ee
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 17 deletions.
3 changes: 1 addition & 2 deletions test/stripe/connect/account_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,8 @@ defmodule Stripe.AccountTest do
end

test "is deletable" do
assert {:ok, %{deleted: deleted, id: _id}} = Stripe.Account.delete("acct_123")
assert {:ok, %Stripe.Account{}} = Stripe.Account.delete("acct_123")
assert_stripe_requested(:delete, "/v1/accounts/acct_123")
assert deleted == true
end

test "is listable" do
Expand Down
3 changes: 1 addition & 2 deletions test/stripe/connect/recipient_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,8 @@ defmodule Stripe.RecipientTest do
end

test "is deletable" do
assert {:ok, %{deleted: deleted, id: _id}} = Stripe.Recipient.delete("recip_123")
assert {:ok, %Stripe.Recipient{}} = Stripe.Recipient.delete("recip_123")
assert_stripe_requested(:delete, "/v1/recipients/recip_123")
assert deleted == true
end

test "is listable" do
Expand Down
5 changes: 2 additions & 3 deletions test/stripe/core_resources/customer_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,10 @@ defmodule Stripe.CustomerTest do
assert_stripe_requested(:post, "/v1/customers/cus_123")
end

test "is deleteable" do
test "is deleteble" do
{:ok, customer} = Stripe.Customer.retrieve("cus_123")
assert {:ok, %{deleted: deleted, id: _id}} = Stripe.Customer.delete(customer)
assert {:ok, %Stripe.Customer{}} = Stripe.Customer.delete(customer)
assert_stripe_requested(:delete, "/v1/customers/#{customer.id}")
assert deleted === true
end

test "is listable" do
Expand Down
5 changes: 2 additions & 3 deletions test/stripe/relay/sku_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,9 @@ defmodule Stripe.SkuTest do
assert_stripe_requested(:post, "/v1/skus/sku_123")
end

test "is deleteable" do
assert {:ok, %{deleted: deleted, id: _id}} = Stripe.Sku.delete("sku_123")
test "is deletable" do
assert {:ok, %Stripe.Sku{}} = Stripe.Sku.delete("sku_123")
assert_stripe_requested(:delete, "/v1/skus/sku_123/delete")
assert deleted
end

test "is listable" do
Expand Down
5 changes: 2 additions & 3 deletions test/stripe/subscriptions/coupon_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,8 @@ defmodule Stripe.CouponTest do
assert_stripe_requested(:post, "/v1/coupons/25OFF")
end

test "is deleteable" do
assert {:ok, %{deleted: deleted, id: _id}} = Stripe.Coupon.delete("25OFF")
test "is deletable" do
assert {:ok, %Stripe.Coupon{}} = Stripe.Coupon.delete("25OFF")
assert_stripe_requested(:delete, "/v1/coupons/25OFF")
assert deleted == true
end
end
3 changes: 1 addition & 2 deletions test/stripe/subscriptions/plan_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,8 @@ defmodule Stripe.PlanTest do
describe "delete/2" do
test "deletes a Plan" do
{:ok, plan} = Stripe.Plan.retrieve("sapphire-elite")
assert {:ok, %{deleted: deleted, id: _id}} = Stripe.Plan.delete(plan)
assert {:ok, %Stripe.Plan{}} = Stripe.Plan.delete(plan)
assert_stripe_requested(:delete, "/v1/plans/#{plan.id}")
assert deleted === true
end
end

Expand Down
3 changes: 1 addition & 2 deletions test/stripe/subscriptions/subscription_item_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,8 @@ defmodule Stripe.SubscriptionItemTest do
describe "delete/2" do
test "deletes a subscription" do
{:ok, subscription_item} = Stripe.SubscriptionItem.retrieve("sub_123")
assert {:ok, %{deleted: deleted, id: _id}} = Stripe.SubscriptionItem.delete("sub_123")
assert {:ok, %Stripe.SubscriptionItem{}} = Stripe.SubscriptionItem.delete("sub_123")
assert_stripe_requested(:delete, "/v1/subscriptions/#{subscription_item.id}")
assert deleted === true
end
end

Expand Down

0 comments on commit 41084ee

Please sign in to comment.