saucy 0.2.7 → 0.2.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -13,7 +13,10 @@ class PlansController < ApplicationController
|
|
13
13
|
def update
|
14
14
|
@plans = Plan.all
|
15
15
|
@account = current_account
|
16
|
-
@account.save_braintree!(params[:account])
|
17
|
-
|
16
|
+
if @account.save_braintree!(params[:account])
|
17
|
+
redirect_to edit_account_path(@account), :notice => t('.update.notice', :default => "Plan changed successfully")
|
18
|
+
else
|
19
|
+
render :edit
|
20
|
+
end
|
18
21
|
end
|
19
22
|
end
|
@@ -49,6 +49,32 @@ Feature: Manage Plan
|
|
49
49
|
And I follow "Billing"
|
50
50
|
Then I should see "card ending in 1111"
|
51
51
|
|
52
|
+
Scenario: Change the plan from free to paid with credit card number
|
53
|
+
Given that the credit card "4111112" is invalid
|
54
|
+
And a plan exists with a name of "Free"
|
55
|
+
And a paid plan exists with a name of "Basic"
|
56
|
+
And the following account exists:
|
57
|
+
| name | keyword | plan |
|
58
|
+
| Test | test | name: Free |
|
59
|
+
And I have signed in with "joe@example.com/test"
|
60
|
+
And "joe@example.com" is an admin of the "Test" account
|
61
|
+
When I go to the settings page for the "Test" account
|
62
|
+
Then I should not see "Billing" within ".tabs"
|
63
|
+
Then I should see "Your Plan"
|
64
|
+
And I follow "Upgrade"
|
65
|
+
Then I should see "Upgrade Your Plan"
|
66
|
+
When I choose the "Basic" plan
|
67
|
+
Then I should see "Billing Information"
|
68
|
+
And I fill in "Cardholder name" with "Ralph Robot"
|
69
|
+
And I fill in "Billing email" with "accounting@example.com"
|
70
|
+
And I fill in "Card number" with "4111112"
|
71
|
+
And I fill in "Verification code" with "123"
|
72
|
+
And I select "March" from "Expiration month"
|
73
|
+
And I select "2020" from "Expiration year"
|
74
|
+
When I press "Upgrade"
|
75
|
+
Then I should not see "Plan changed successfully"
|
76
|
+
And "Card number" should have the error "is invalid"
|
77
|
+
|
52
78
|
Scenario: Change the plan to a free on an account with a paid plan
|
53
79
|
Given a paid plan exists with a name of "Basic"
|
54
80
|
And a plan exists with a name of "Free"
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: saucy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 7
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 2
|
9
|
-
-
|
10
|
-
version: 0.2.
|
9
|
+
- 8
|
10
|
+
version: 0.2.8
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- thoughtbot, inc.
|