-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Write feature tests for handling unsigned stripe events (#74)
See: #66 This is just a small step, and doesn't include the actual implementation but it gives us a seam to move forward with and generate user-facing feature documentation from.
- Loading branch information
Showing
5 changed files
with
71 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#!/usr/bin/env ruby | ||
# frozen_string_literal: true | ||
|
||
# | ||
# This file was generated by Bundler. | ||
# | ||
# The application 'cucumber' is installed as part of a gem, and | ||
# this file is here to facilitate running it. | ||
# | ||
|
||
require "pathname" | ||
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", | ||
Pathname.new(__FILE__).realpath) | ||
|
||
bundle_binstub = File.expand_path("../bundle", __FILE__) | ||
|
||
if File.file?(bundle_binstub) | ||
if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/ | ||
load(bundle_binstub) | ||
else | ||
abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run. | ||
Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.") | ||
end | ||
end | ||
|
||
require "rubygems" | ||
require "bundler/setup" | ||
|
||
load Gem.bin_path("cucumber", "cucumber") |
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 |
---|---|---|
|
@@ -10,3 +10,6 @@ set -vx | |
|
||
# Run RSpec | ||
bin/rspec | ||
|
||
# Run Cucumber | ||
bin/cucumber |
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,17 @@ | ||
@stripe @event-handling | ||
Feature: Handling Stripe Events | ||
In order to give my clients value because they paid me | ||
As a Client Developer | ||
I would like to be able to handle stripe events | ||
|
||
@future @security | ||
Scenario: Event handler rejects Unsigned Stripe Webhook Events | ||
Given Compensated is configured to reject unsigned Stripe Events | ||
When an Unsigned Stripe Event is request is passed into the Compensated::RequestHandler | ||
Then the Request Handler raises a Compensated::UnsignedEventError when transforming the event data | ||
|
||
@future @security | ||
Scenario: Event handler accepts Unsigned Stripe Webhook Events | ||
Given Compensated is configured to accept unsigned Stripe Events | ||
When an Unsigned Stripe Event is request is passed into the Compensated::RequestHandler | ||
Then the Request Handler transforms the event data |
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,21 @@ | ||
|
||
Given("Compensated is configured to reject unsigned Stripe Events") do | ||
pending # Write code here that turns the phrase above into concrete actions | ||
end | ||
|
||
Given("Compensated is configured to accept unsigned Stripe Events") do | ||
pending # Write code here that turns the phrase above into concrete actions | ||
end | ||
|
||
|
||
When("an Unsigned Stripe Event is request is passed into the Compensated::RequestHandler") do | ||
pending # Write code here that turns the phrase above into concrete actions | ||
end | ||
|
||
Then("the Request Handler raises a Compensated::UnsignedEventError when transforming the event data") do | ||
pending # Write code here that turns the phrase above into concrete actions | ||
end | ||
|
||
Then("the Request Handler transforms the event data") do | ||
pending # Write code here that turns the phrase above into concrete actions | ||
end |