saucy 0.2.10 → 0.2.11
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.
- data/app/controllers/plans_controller.rb +3 -3
- data/app/views/billings/show.html.erb +3 -2
- data/lib/generators/saucy/features/templates/features/sign_up_paid.feature +4 -2
- data/lib/generators/saucy/features/templates/step_definitions/plan_steps.rb +7 -0
- data/lib/saucy/plan.rb +4 -0
- data/spec/models/plan_spec.rb +11 -0
- metadata +28 -28
@@ -2,16 +2,16 @@ class PlansController < ApplicationController
|
|
2
2
|
layout Saucy::Layouts.to_proc
|
3
3
|
|
4
4
|
def index
|
5
|
-
@plans = Plan.
|
5
|
+
@plans = Plan.ordered
|
6
6
|
end
|
7
7
|
|
8
8
|
def edit
|
9
|
-
@plans = Plan.
|
9
|
+
@plans = Plan.ordered
|
10
10
|
@account = current_account
|
11
11
|
end
|
12
12
|
|
13
13
|
def update
|
14
|
-
@plans = Plan.
|
14
|
+
@plans = Plan.ordered
|
15
15
|
@account = current_account
|
16
16
|
if @account.save_braintree!(params[:account])
|
17
17
|
redirect_to edit_account_path(@account), :notice => t('.update.notice', :default => "Plan changed successfully")
|
@@ -1,6 +1,7 @@
|
|
1
1
|
<% if current_user.admin_of?(current_account) -%>
|
2
2
|
<div class="current_credit_card">
|
3
|
-
|
3
|
+
<h3>Billing Information</h3>
|
4
|
+
<p>We're currently charging the credit card ending in <%= current_account.credit_card.last_4 %>. <%= link_to "Change", edit_account_billing_path(current_account) %></p>
|
4
5
|
</div>
|
5
6
|
<div class="billing_history">
|
6
7
|
<h3>Your Invoices</h3>
|
@@ -17,7 +18,7 @@
|
|
17
18
|
<% end -%>
|
18
19
|
</table>
|
19
20
|
<% else -%>
|
20
|
-
There have been no invoices yet
|
21
|
+
<p>There have been no invoices yet.</p>
|
21
22
|
<% end -%>
|
22
23
|
</div>
|
23
24
|
<% end -%>
|
@@ -5,10 +5,11 @@ Feature: Sign up
|
|
5
5
|
|
6
6
|
Background:
|
7
7
|
Given a paid plan exists with a name of "Paid"
|
8
|
+
And a plan exists with a name of "Free"
|
8
9
|
|
9
10
|
Scenario: User signs up for a paid plan with invalid data
|
10
11
|
When I go to the sign up page for the "Paid" plan
|
11
|
-
|
12
|
+
Then I should see "Paid"
|
12
13
|
And I should see "$1/month"
|
13
14
|
And the "Card number" field should have autocomplete off
|
14
15
|
And the "Verification code" field should have autocomplete off
|
@@ -21,7 +22,8 @@ Feature: Sign up
|
|
21
22
|
|
22
23
|
Scenario: User signs up for a paid plan with valid data
|
23
24
|
When I go to the list of plans page
|
24
|
-
|
25
|
+
Then I should see the "Paid" plan before the "Free" plan
|
26
|
+
When I follow "Paid"
|
25
27
|
And I fill in "Email" with "email@person.com"
|
26
28
|
And I fill in "Password" with "password"
|
27
29
|
And I fill in "Confirm password" with "password"
|
@@ -7,3 +7,10 @@ Then /^the "([^"]*)" plan should be disabled$/ do |plan_name|
|
|
7
7
|
input_id = page.find(:xpath, "//label/p[contains(text(),'#{plan_name}')]/../@for").node.value
|
8
8
|
page.should have_css("##{input_id}[disabled='disabled']")
|
9
9
|
end
|
10
|
+
|
11
|
+
When /^I should see the "([^"]*)" plan before the "([^"]*)" plan$/ do |first_plan_name, second_plan_name|
|
12
|
+
first_expression = Regexp.escape(first_plan_name)
|
13
|
+
second_expression = Regexp.escape(second_plan_name)
|
14
|
+
joint_expression = /#{first_expression}.*#{second_expression}/m
|
15
|
+
page.body.should =~ joint_expression
|
16
|
+
end
|
data/lib/saucy/plan.rb
CHANGED
data/spec/models/plan_spec.rb
CHANGED
@@ -52,3 +52,14 @@ describe Plan, "with limits" do
|
|
52
52
|
subject.allows?(:lighthouse).should be
|
53
53
|
end
|
54
54
|
end
|
55
|
+
|
56
|
+
|
57
|
+
describe Plan, "with prices" do
|
58
|
+
let!(:free) { Factory(:plan, :price => 0) }
|
59
|
+
let!(:least) { Factory(:plan, :price => 1) }
|
60
|
+
let!(:most) { Factory(:plan, :price => 2) }
|
61
|
+
|
62
|
+
it "gives them from most to least expensive when ordered" do
|
63
|
+
Plan.ordered.should == [most, least, free]
|
64
|
+
end
|
65
|
+
end
|
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: 1
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 2
|
9
|
-
-
|
10
|
-
version: 0.2.
|
9
|
+
- 11
|
10
|
+
version: 0.2.11
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- thoughtbot, inc.
|
@@ -17,14 +17,13 @@ autorequire:
|
|
17
17
|
bindir: bin
|
18
18
|
cert_chain: []
|
19
19
|
|
20
|
-
date: 2011-01-
|
20
|
+
date: 2011-01-30 00:00:00 -05:00
|
21
21
|
default_executable:
|
22
22
|
dependencies:
|
23
23
|
- !ruby/object:Gem::Dependency
|
24
|
-
type: :runtime
|
25
|
-
prerelease: false
|
26
24
|
name: formtastic
|
27
|
-
|
25
|
+
prerelease: false
|
26
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
28
27
|
none: false
|
29
28
|
requirements:
|
30
29
|
- - ">="
|
@@ -34,12 +33,12 @@ dependencies:
|
|
34
33
|
- 1
|
35
34
|
- 2
|
36
35
|
version: "1.2"
|
37
|
-
requirement: *id001
|
38
|
-
- !ruby/object:Gem::Dependency
|
39
36
|
type: :runtime
|
40
|
-
|
37
|
+
version_requirements: *id001
|
38
|
+
- !ruby/object:Gem::Dependency
|
41
39
|
name: railties
|
42
|
-
|
40
|
+
prerelease: false
|
41
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
43
42
|
none: false
|
44
43
|
requirements:
|
45
44
|
- - ">="
|
@@ -50,12 +49,12 @@ dependencies:
|
|
50
49
|
- 0
|
51
50
|
- 3
|
52
51
|
version: 3.0.3
|
53
|
-
requirement: *id002
|
54
|
-
- !ruby/object:Gem::Dependency
|
55
52
|
type: :runtime
|
56
|
-
|
53
|
+
version_requirements: *id002
|
54
|
+
- !ruby/object:Gem::Dependency
|
57
55
|
name: braintree
|
58
|
-
|
56
|
+
prerelease: false
|
57
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
59
58
|
none: false
|
60
59
|
requirements:
|
61
60
|
- - ">="
|
@@ -66,12 +65,12 @@ dependencies:
|
|
66
65
|
- 6
|
67
66
|
- 2
|
68
67
|
version: 2.6.2
|
69
|
-
requirement: *id003
|
70
|
-
- !ruby/object:Gem::Dependency
|
71
68
|
type: :runtime
|
72
|
-
|
69
|
+
version_requirements: *id003
|
70
|
+
- !ruby/object:Gem::Dependency
|
73
71
|
name: sham_rack
|
74
|
-
|
72
|
+
prerelease: false
|
73
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
75
74
|
none: false
|
76
75
|
requirements:
|
77
76
|
- - "="
|
@@ -82,12 +81,12 @@ dependencies:
|
|
82
81
|
- 3
|
83
82
|
- 3
|
84
83
|
version: 1.3.3
|
85
|
-
requirement: *id004
|
86
|
-
- !ruby/object:Gem::Dependency
|
87
84
|
type: :runtime
|
88
|
-
|
85
|
+
version_requirements: *id004
|
86
|
+
- !ruby/object:Gem::Dependency
|
89
87
|
name: sinatra
|
90
|
-
|
88
|
+
prerelease: false
|
89
|
+
requirement: &id005 !ruby/object:Gem::Requirement
|
91
90
|
none: false
|
92
91
|
requirements:
|
93
92
|
- - "="
|
@@ -98,12 +97,12 @@ dependencies:
|
|
98
97
|
- 1
|
99
98
|
- 2
|
100
99
|
version: 1.1.2
|
101
|
-
|
100
|
+
type: :runtime
|
101
|
+
version_requirements: *id005
|
102
102
|
- !ruby/object:Gem::Dependency
|
103
|
-
type: :development
|
104
|
-
prerelease: false
|
105
103
|
name: aruba
|
106
|
-
|
104
|
+
prerelease: false
|
105
|
+
requirement: &id006 !ruby/object:Gem::Requirement
|
107
106
|
none: false
|
108
107
|
requirements:
|
109
108
|
- - "="
|
@@ -114,7 +113,8 @@ dependencies:
|
|
114
113
|
- 2
|
115
114
|
- 6
|
116
115
|
version: 0.2.6
|
117
|
-
|
116
|
+
type: :development
|
117
|
+
version_requirements: *id006
|
118
118
|
description: Clearance-based Rails engine for Software as a Service (Saas) that provides account and project management
|
119
119
|
email: support@thoughtbot.com
|
120
120
|
executables: []
|