-
Notifications
You must be signed in to change notification settings - Fork 552
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3c7995f
commit 66a6f5d
Showing
4 changed files
with
43 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# frozen_string_literal: true | ||
|
||
module Stripe | ||
class Review < APIResource | ||
extend Stripe::APIOperations::List | ||
|
||
OBJECT_NAME = "review".freeze | ||
|
||
def approve(params = {}, opts = {}) | ||
resp, opts = request(:post, resource_url + "/approve", params, opts) | ||
initialize_from(resp.data, opts) | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# frozen_string_literal: true | ||
|
||
require ::File.expand_path("../../test_helper", __FILE__) | ||
|
||
module Stripe | ||
class ReviewTest < Test::Unit::TestCase | ||
should "be listable" do | ||
reviews = Stripe::Review.review | ||
assert_requested :get, "#{Stripe.api_base}/v1/reviews" | ||
assert reviews.data.is_a?(Array) | ||
assert reviews.first.is_a?(Stripe::Review) | ||
end | ||
|
||
should "be retrievable" do | ||
review = Stripe::Review.retrieve("prv_123") | ||
assert_requested :get, "#{Stripe.api_base}/v1/reviews/prv_123" | ||
assert review.is_a?(Stripe::Review) | ||
end | ||
|
||
should "be approvable" do | ||
review = Stripe::Review.retrieve("prv_123") | ||
review.approve | ||
assert_requested :post, "#{Stripe.api_base}/v1/reviews/prv_123/approve" | ||
assert review.is_a?(Stripe::Review) | ||
end | ||
end | ||
end |