From 425adb95888b878400d7e50ec6dad44729ff7a96 Mon Sep 17 00:00:00 2001 From: Jeff Browning Date: Fri, 6 Jun 2014 09:18:39 -0400 Subject: [PATCH 1/2] Add failing scenarios for CVV verification of an existing card --- features/cards.feature | 60 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 59 insertions(+), 1 deletion(-) diff --git a/features/cards.feature b/features/cards.feature index 025ffd1..5200f28 100644 --- a/features/cards.feature +++ b/features/cards.feature @@ -36,7 +36,6 @@ Feature: Credit cards } """ - Scenario: Retrieve a card Given I have tokenized a card When I GET to /cards/:card_id giving the card_id @@ -580,6 +579,65 @@ Feature: Credit cards } """ + @failing + Scenario: CVV matches for a previously-tokenized card + When I PUT to /cards/:card_id giving the card_id, with the body: + """ + { + "cards": [{ + "cvv": "123" + }] + } + """ + + Then I should get a 200 OK status code + And the response is valid according to the "cards" schema + And the fields on this card match: + """ + { + "cvv_match": "yes" + } + """ + + @failing + Scenario: CVV does not match for a previously-tokenized card + When I PUT to /cards/:card_id giving the card_id, with the body: + """ + { + "cards": [{ + "cvv": "200" + }] + } + """ + + Then I should get a 200 OK status code + And the response is valid according to the "cards" schema + And the fields on this card match: + """ + { + "cvv_match": "no" + } + """ + @failing + Scenario: CVV is unsupported for a previously-tokenized card + When I PUT to /cards/:card_id giving the card_id, with the body: + """ + { + "cards": [{ + "cvv": "901" + }] + } + """ + + Then I should get a 200 OK status code + And the response is valid according to the "cards" schema + And the fields on this card match: + """ + { + "cvv_match": "unsupported" + } + """ + Scenario: Adding card metadata Given I have tokenized a card When I make a PATCH request to the href "href" with the body: From e41d780b4e91061a5bf3770a5dd88e3426c582f8 Mon Sep 17 00:00:00 2001 From: Jeff Browning Date: Fri, 6 Jun 2014 09:45:29 -0400 Subject: [PATCH 2/2] Make it more explicit that this is a re-verification of CVV --- features/cards.feature | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/features/cards.feature b/features/cards.feature index 5200f28..4001eec 100644 --- a/features/cards.feature +++ b/features/cards.feature @@ -580,7 +580,7 @@ Feature: Credit cards """ @failing - Scenario: CVV matches for a previously-tokenized card + Scenario: CVV re-verification matches When I PUT to /cards/:card_id giving the card_id, with the body: """ { @@ -600,7 +600,7 @@ Feature: Credit cards """ @failing - Scenario: CVV does not match for a previously-tokenized card + Scenario: CVV re-verification does not match When I PUT to /cards/:card_id giving the card_id, with the body: """ { @@ -618,8 +618,9 @@ Feature: Credit cards "cvv_match": "no" } """ + @failing - Scenario: CVV is unsupported for a previously-tokenized card + Scenario: CVV re-verification is unsupported When I PUT to /cards/:card_id giving the card_id, with the body: """ {