-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Suport reschedule payment #70
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,8 @@ | |
|
||
## Next version | ||
|
||
- Add support for register error | ||
|
||
## v1.1.2 | ||
|
||
- Add `timezone` to charge config | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -381,6 +381,27 @@ | |
end | ||
end | ||
|
||
describe "#reschedule" do | ||
it "returns ok" do | ||
VCR.use_cassette("payments/reschedule/success") do | ||
charge = subject.reschedule(100, { date: Date.new(2018, 10, 2) }) | ||
expect(charge).to be_a(entity_klass) | ||
expect(charge.id).to eql(100) | ||
expect(charge.registration_status).to eql("reschedule_started") | ||
end | ||
end | ||
|
||
context "when the payment can not be rescheduled" do | ||
it "returns false" do | ||
VCR.use_cassette("payments/reschedule/fail") do | ||
expect do | ||
charge = subject.reschedule(49, { date: Date.new(2018, 10, 2) }) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Lint/UselessAssignment: Useless assignment to variable - charge. |
||
end.to raise_error(Cobrato::RequestError) | ||
end | ||
end | ||
end | ||
end | ||
|
||
describe "#register_error" do | ||
it "returns ok" do | ||
VCR.use_cassette("payments/register_error/success") do | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Style/BracesAroundHashParameters: Redundant curly braces around a hash parameter.